Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hpx_0.9.99 out of project build fails #2311

Closed
npezolano opened this issue Aug 28, 2016 · 6 comments
Closed

hpx_0.9.99 out of project build fails #2311

npezolano opened this issue Aug 28, 2016 · 6 comments

Comments

@npezolano
Copy link
Contributor

npezolano commented Aug 28, 2016

env

  • Ubuntu 64bit 4.2.0-42-generic
    
  • gcc version 5.2.1
    
  • hpx 0.9.99
    
  • boost 0.16.0
    

The HPX examples run fine but while building out of project the compiler is looking for C++14 functions

$ g++ main.cpp -I~/include -L~/lib -std=c++11 -o main
In file included from /home/n/git/cpp/libs/include/hpx/util/invoke_fused.hpp:13:0,
                 from /home/n/git/cpp/libs/include/hpx/util/bind.hpp:19,
                 from /home/n/git/cpp/libs/include/hpx/hpx_init_impl.hpp:16,
                 from /home/n/git/cpp/libs/include/hpx/hpx_init.hpp:716,
                 from main.cpp:1:
/home/n/git/cpp/libs/include/hpx/util/tuple.hpp:103:18: error: ‘is_final’ is not a member of ‘std’
              && !std::is_final<T>::value
                  ^
/home/n/git/cpp/libs/include/hpx/util/tuple.hpp:100:27: error: parse error in template argument list
             typename std::enable_if<
                           ^
/home/n/git/cpp/libs/include/hpx/util/tuple.hpp:105:13: error: template argument 3 is invalid
             >::type
             ^
/home/n/git/cpp/libs/include/hpx/util/tuple.hpp:106:9: error: expected unqualified-id before ‘>’ token
         > : T
         ^

Building main.cpp with -std=c++14 creates undefined reference errors:

/tmp/ccu3L4Wv.o: In function `(anonymous namespace)::check_hpx_version()':
main.cpp:(.text+0x1b): undefined reference to `hpx::hpx_check_version_0_9'
main.cpp:(.text+0x23): undefined reference to `hpx::hpx_check_boost_version_106100'
/tmp/ccu3L4Wv.o: In function `hpx_main(boost::program_options::variables_map&)':
main.cpp:(.text+0x4e): undefined reference to `hpx::throws'
/tmp/ccu3L4Wv.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0x2da): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x2e6): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x2f2): undefined reference to `boost::system::system_category()'
@sithhell
Copy link
Member

sithhell commented Aug 28, 2016 via email

@npezolano
Copy link
Contributor Author

Sure sorry about that, I'm just trying to build a simple "hello world" program in my own project.

I built boost as follows:

./b2 -j32 --build-type=complete --layout=versioned toolset=gcc

for hpx:

cmake -DHPX_WITH_MALLOC=system \
      -DBOOST_ROOT=/home/n/git/cpp/libs \
      -DCMAKE_INSTALL_PREFIX=/home/n/git/cpp/libs \
      /home/n/git/cpp/downloads/hpx

I also tried adding cxxflags="-std=c++14" for boost and -DCMAKE_CXX_FLAGS="-std=c++14" for hpx and I get the same error when I compile in the first post.

@sithhell
Copy link
Member

Ah, sorry for being dense. Your detailed description wasn't showing in my mail client.
First of all, yes, the c++ flavor chosen for hpx is probably not transparent enough...

Second, you need to link against the hpx libraries. You can either choose our cmake support our use pkg-config to get the correct settings. The docs are here:
http://stellar-group.github.io/hpx/docs/html/hpx/manual/build_system/using_hpx/pkgconfig.html

Does this fix your problem? Do you think the docs need to be extended to avoid future misunderstandings?

@hkaiser
Copy link
Member

hkaiser commented Aug 28, 2016

@npezolano This error happens whenever you build HPX with --std=c++14 (which is the default for any recent compiler) but your application is built using --std=c++11. You can enforce building HPX in C++11 mode by supplying -DHPX_WITH_CXX11=On to the cmake command line. Alternatively you can build your application using --std=c++14.

@npezolano
Copy link
Contributor Author

@hkaiser @sithhell Thanks I was able to get it working, I can post a sample out of project build using Scons if it will help anyone.

@hkaiser
Copy link
Member

hkaiser commented Aug 29, 2016

Yes, please do! We could add that to the docs.

@hkaiser hkaiser closed this as completed Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants