Comments (9)
Steps on Windows look roughly like this:
- Download and carefully unzip it somewhere else and add a "-mingw" suffix to the directory name. https://github.com/google/protobuf/archive/v3.0.0-beta-2.tar.gz
mkdir install_dir
mkdir cmake_build
cd cmake_build
cmake -DCMAKE_INSTALL_PREFIX=../install_dir -DCMAKE_INSTALL_LIBDIR=lib -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_CXX_FLAGS="-std=c++11" -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" ../cmake
mingw32-make
mingw32-make install
from libarcus.
For some reason, Protobuf's repository recommends building Protobuf in the msys environment. I don't find that necessary (any more). They have a perfectly functional CMake script.
I suggest downloading CMake (cmake.org), opening up the cmake-gui, then navigating it to /cmake/ for the source directory (choose any build directory you like). You can select native MinGW bindings. Then click configure and generate. Next, navigate a terminal (just a normal one, not an msys terminal) to your build directory,the one you entered in CMake, and type mingw32-make
. It should build itself.
from libarcus.
Yeah, on Windows you definitely want to use protobuf's cmake build system as it work way better. We use the CMake scripts for building as part of cura-build and I have not had any issues with it so far.
from libarcus.
Hi Ghostkeeper, awhiemstra and sedwards2009,
Really appreciation for your reply. I have tried Ghostkeeper and awhiemstra's methods, but it doesn't work for me. Sorry for my stupid.
So I tried sedwards2009's method, but in step
-
cmake -DCMAKE_INSTALL_PREFIX=../install_dir -DCMAKE_INSTALL_LIBDIR=lib -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_CXX_FLAGS="-std=c++11" -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" ../cmake
I got some message:
C:\SlicerSoftware\Cura\protobuf-master\cmake_build>cmake -DCMAKE_INSTALL_PREFIX=../install_dir -DCMAKE_INSTALL_LIBDIR=lib -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_CXX_FLAGS="-std=c++11" -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" ../cmake
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/CMakeMinGWFindMake.cmake:22 (message):
sh.exe was found in your PATH, here:
C:/MinGW/msys/1.0/bin/sh.exe
For MinGW make to work correctly sh.exe must NOT be in your path.
Run cmake from a shell that does not have sh.exe in your PATH.
If you want to use a UNIX shell, then use MSYS Makefiles.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
I really don't know what that mean, so I tried that step again, and this time it produce message:
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR)
-- Configuring done
-- Generating done
-- Build files have been written to: C:/SlicerSoftware/Cura/protobuf-master/cmake_build
So I tried the next step "mingw32-make", but I got an error message:
c:\mingw\include\math.h: In function 'float hypotf(float, float)':
c:\mingw\include\math.h:635:30: error: '_hypot' was not declared in this scope
{ return (float)(_hypot (x, y)); }
People said it's a bug of MinGW. I am really confused about that. Can you guys give me further information?
Thanks.
Ding
from libarcus.
I used the compiler version from http://mingw-w64.org/doku.php/download/mingw-builds, the version more mingw and less msys2.
from libarcus.
Thanks all.
Sorry, I've relied on MS VisualStudio tools too much.
Today, I used CMake ui to build protobuf again. I choose the compiler as Visual Studio 2010 in CMake and take reference of README.md (in dir C:\SlicerSoftware\Cura\protobuf-master\cmake). After several steps, I've built the protobuf. The building ouput is in C:\SlicerSoftware\Cura\install, and the "install" contain sub dirs "bin", "include" and "lib". It looks good.
Since protobuf can be built by CMake, so I tried to build libArcus using CMake too. The libArcs is in
"C:\SlicerSoftware\Cura\libArcus-master". But using the CMake ui, and define
the source code as "C:/SlicerSoftware/Cura/libArcus-master",
define the binaries as "C:/SlicerSoftware/Cura/libArcus-master/build",
and choose MS VS2010,
after clicking "Configure", I got error message in CMake ui:
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find Protobuf (missing: PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
(Required is at least version "3.0.0")
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/FindProtobuf.cmake:308 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:13 (find_package)
How to fix it?
Thanks in advance.
Ding
from libarcus.
You've built Protobuf somewhere on your computer, but when building libArcus, it doesn't know where to find the Protobuf binaries and headers for some reason.
In the CMake GUI there should be two variables which it indicates are missing (you might have to activate advanced mode): PROTOBUF_LIBRARY and PROTOBUF_INCLUDE_DIR.
For PROTOBUF_LIBRARY, look in the "lib" folder of C:\SlicerSoftware\Cura\install. That should contain either a .dll or .a file of Protobuf (also Protobuf-lite and possibly a Debug variant, but ignore those).
For PROTOBUF_INCLUDE_DIR, point it to that "include" folder in your install directory. It should contain a folder marked "google", which has a subfolder marked "protobuf".
from libarcus.
Hi Ghostkeeper,
Thanks for your information. I've reinstalled MSYS2, MinGW-64, and some other libs. Finally I've built the protobuf, the protobuf's libs and includes showed in "C:\msys32\usr\local". Then, I try to built libArcs, but when I use command "cmake ..", I got the following error information.
$ cmake ..
-- Could NOT find PROTOBUF (missing: PROTOBUF_LIBRARY)
Traceback (most recent call last):
File "C:/msys32/local/libArcus-master/cmake/FindSIP.py", line 8, in import sipconfig
ImportError: No module named 'sipconfig'
CMake Error at cmake/FindSIP.cmake:58 (MESSAGE):
Could not find SIP Call Stack (most recent call first):
CMakeLists.txt:22 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/msys32/local/libArcus-master/build/CMakeFiles/CMakeOutput.log".
I've searched your another thread about "sip.h". Your suggestion is to install sip package. But when I tried to use command "pacman -S sip-dev", I get nothing. I also tried
"pacman -S python-sipconfig",
"pacman -S python-sip-dev",
but nothing works for me.
I am new to CMake and MinGW.
Any suggestion is welcome.
Thanks in advance.
Ding
from libarcus.
from libarcus.
Related Issues (20)
- Hide private symbols not hidden by default visibility HOT 2
- MessageTypeStore class should (probably) be exported HOT 2
- how to set cmake to Identify anaconda Virtual environment HOT 1
- python3-dev HOT 4
- make error: *** target pattern contains no '%'. Stop. HOT 9
- PYTHON_SITE_PACKAGES_DIR is not honored HOT 10
- Update to SIP5
- HELP: Sip errors on MacOS HOT 4
- sudo command in "Building" section incorrect
- no matching function in protobuf HOT 7
- Action Required: Fix WhiteSource Configuration File - .whitesource
- Build fails with protobuf 3.18 HOT 2
- How do I get SIP on Windows? HOT 1
- Failed to get Python3_SITELIB. Error: when cmake Arcus. HOT 1
- Linking CXX shared library pyArcus.so No such file or directory HOT 2
- Missing sipbuild HOT 7
- error: packages failed to build: arcus-5.0.0-2 HOT 4
- Failing compilation
- unable to built a libArcus
- LICENSE and README.md files disagree on what the license is
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libarcus.