curv3d / curv

a language for making art using mathematics
Apache License 2.0
1.14k stars 73 forks source link

Build error #28

Closed Paul-Wray closed 6 years ago

Paul-Wray commented 6 years ago

Attempting to build on OSX [ 1%] Building CXX object CMakeFiles/libcurv.dir/libcurv/analyser.cc.o In file included from /Users/Paul/curv/libcurv/analyser.cc:7: In file included from /Users/Paul/curv/./libcurv/phrase.h:10: /Users/Paul/curv/./libcurv/shared.h:8:10: fatal error: 'boost/intrusive_ptr.hpp' file not found

include <boost/intrusive_ptr.hpp>

     ^~~~~~~~~~~~~~~~~~~~~~~~~
doug-moen commented 6 years ago

Please refer to the build instructions for macOS in BUILD.md. After installing HomeBrew, there is a command:

brew install boost

which installs this header file.

Paul-Wray commented 6 years ago

I had installed Boost. Will check for Boost install errors, thanks.

On 26 June 2018 at 20:00, Doug Moen notifications@github.com wrote:

Please refer to the build instructions for macOS in BUILD.md. After installing HomeBrew, there is a command:

brew install boost

which installs this header file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/doug-moen/curv/issues/28#issuecomment-400252272, or mute the thread https://github.com/notifications/unsubscribe-auth/AMcfuU623efghurip6V6FsDFR9lu99bHks5uAgYrgaJpZM4U3RYD .

Paul-Wray commented 6 years ago

The file is present at /usr/local/Cellar/boost/1.67.0_1/include/boost Could it be the path, or a new version of Boost? Make confirmed that the Boost library was detected, before it emitted the error.

~/curv : make rm -rf CMakeCache.txt CMakeFiles mkdir -p release cd release; cmake -DCMAKE_BUILD_TYPE=Release .. -- The C compiler identification is AppleClang 9.1.0.9020039 -- The CXX compiler identification is AppleClang 9.1.0.9020039 -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- 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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: /usr/local/bin/python (found version "2.7.15") -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - found -- Found Threads: TRUE
-- Boost version: 1.67.0 -- Found the following Boost libraries: -- iostreams -- system -- thread -- regex -- chrono -- date_time -- atomic -- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11") -- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/OpenGL.framework
-- Configuring done -- Generating done -- Build files have been written to: /Users/Paul/curv/release cd release; make Scanning dependencies of target libcurv [ 1%] Building CXX object CMakeFiles/libcurv.dir/libcurv/analyser.cc.o In file included from /Users/Paul/curv/libcurv/analyser.cc:7: In file included from /Users/Paul/curv/./libcurv/phrase.h:10: /Users/Paul/curv/./libcurv/shared.h:8:10: fatal error: 'boost/intrusive_ptr.hpp' file not found

include <boost/intrusive_ptr.hpp>

     ^~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated. make[3]: [CMakeFiles/libcurv.dir/libcurv/analyser.cc.o] Error 1 make[2]: [CMakeFiles/libcurv.dir/all] Error 2 make[1]: [all] Error 2 make: [release] Error 2 ~/curv :

doug-moen commented 6 years ago

The file /usr/local/include/boost should be present, as a symbolic link to the Cellar. Here's what it looks like on my system:

$ ls -l /usr/local/include/boost
lrwxr-xr-x  1 doug  admin  38 25 Jun 23:08 /usr/local/include/boost -> ../Cellar/boost/1.67.0_1/include/boost

So, check that this symbolic link exists. Check that there aren't permission problems preventing homebrew from creating the symbolic link.

Paul-Wray commented 6 years ago

The symlink exists, and I can follow it to it's destination.

doug-moen commented 6 years ago

This suggests that /usr/local/include is not in the list of standard include directories.

On my system, the following command:

echo | c++ -Wp,-v -x c++ - -fsyntax-only

prints the list of standard include directories known to the compiler, and this list includes /usr/local/include. I am guessing that on your system, /usr/local/include is missing from the list.

Paul-Wray commented 6 years ago

/usr/bin/include is on the list.

Maybe the wrong compiler is being invoked, and its ignoring the list? /usr/bin/c++ is symlinked to clang, but there are also clang++, gcc, cpp However I get the same error if I try 'make CC=...' with each of these.

doug-moen commented 6 years ago

'make CC=' does not work in this build system.

I've pushed a change that forces the C++ compiler to be /usr/bin/c++. The messages printed during the build indicate otherwise, but I've verified that /usr/bin/c++ is actually being used.

See if that works.

Paul-Wray commented 6 years ago

Same error. FYI, cmake seems to be correct too, /usr/local/bin/cmake points to /usr/local/Cellar/cmake/3.11.4/bin

FYI There is apparently a problem with recent versions of OSX requiring a re-install of command line tools to get back the compiler that scans /usr/local for headers. https://stackoverflow.com/questions/32898887/boost-no-longer-works-with-homebrew-on-mac-el-capitan/32929012#32929012 Having updated OSX/XCode recently I was hopeful about this remedy , but unfortunately that doesn't work either.

Paul-Wray commented 6 years ago

Progress! Now libcurv build completes, but we have a similar error building glsviewer:/Users/Paul/curv/extern/glslViewer/src/gl/gl.h:3:10: fatal error: 'GLFW/glfw3.h' file not found

doug-moen commented 6 years ago

This commit should fix the problem. I verified that /usr/local/include is being searched while building all submodules: https://github.com/doug-moen/curv/commit/4c2aaa0c2d2c58428f6e1c077e1a489572a38be8

Paul-Wray commented 6 years ago

All compile steps complete now, but the linker can't find the 'double-conversion' library:

[100%] Linking CXX executable curv ld: library not found for -ldouble-conversion clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: [curv] Error 1 make[2]: [CMakeFiles/curv.dir/all] Error 2 make[1]: [all] Error 2 make: [release] Error 2

Paul-Wray commented 6 years ago

Sorry for delay, I've been away Build completes now and I can start up the program. Thanks for your prompt fixes, I look forward to exploring the application.

PS & FYI, I have not received email updates for the issues I raised for curv. I guess this is due to your config.

doug-moen commented 6 years ago

Thanks, @Paul-Wray.