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_PREFIX is too fragile #1252

Closed
eschnett opened this issue Sep 9, 2014 · 8 comments

Comments

Projects
None yet
4 participants
@eschnett
Copy link
Contributor

commented Sep 9, 2014

I am trying to use HPX from Cactus. Cactus uses autoconf and make, and this cannot handle the definition of HPX_PREFIX: HPX_PREFIX needs to expand to a C string, including double quotes, and it is basically impossible to have autotools or make preserve double quotes.

Could you modify this mechanism? One option would be to set HPX_PREFIX when installing (e.g. using sed), or to auto-generate a small include file that contains a #define HPX_PREFIX, or to allow HPX_PREFIX to remain undefined at build time and to require it to be set explicitly at run time. Each of these would work fine for Cactus.

@eschnett

This comment has been minimized.

Copy link
Contributor Author

commented Sep 9, 2014

I think that executing this command

  perl -pi -e "s+HPX_PREFIX+\"$HPX_DIR\"+" $HPX_DIR/include/hpx/hpx_init_impl.hpp

after installing HPX removes the need for defining HPX_PREFIX, which would then solve the problem for us.

@eschnett

This comment has been minimized.

Copy link
Contributor Author

commented Sep 10, 2014

This topic was discussed on IRC. "zao" was unable to see the several suggestions I made in the ticket above to remedy this; therefore, let me repeat them here, explicitly numbered:

  1. set HPX_PREFIX when installing (e.g. using sed)
  2. auto-generate a small include file that contains a #define HPX_PREFIX
  3. allow HPX_PREFIX to remain undefined at build time and to require it to be set explicitly at run time
  4. use a particular perl command I list above.
@hkaiser

This comment has been minimized.

Copy link
Member

commented Sep 10, 2014

Frankly, I still miss why this should be done.

@sithhell

This comment has been minimized.

Copy link
Member

commented Sep 11, 2014

I know what to do here. Will fix this today.

@stevenrbrandt

This comment has been minimized.

Copy link
Member

commented Sep 18, 2014

I have the same problem. Until this is fixed, the instructions at http://stellar.cct.lsu.edu/files/hpx_0.9.5/html/hpx/manual/cmake/unix_apps_pkg_config.html won't work.

Instead of doing this:

 c++ -o hello_world hello_world.cpp `pkg-config --cflags --libs hpx_application` -liostreams \
     -DHPX_APPLICATION_NAME=hello_world

You have to do this:

c++ -o hello_world hello_world.cpp \
    $(pkg-config --cflags --libs hpx_application|perl -p -e 's/\\"/"/g') \
    -liostreams -DHPX_APPLICATION_NAME=hello_world
@sithhell

This comment has been minimized.

Copy link
Member

commented Sep 18, 2014

The reason why i didn't catch this is because our "build unit test" works
just fine without the search and replace.
See here for the example Makefile:
https://github.com/STEllAR-GROUP/hpx/blob/master/tests/unit/build/src/Makefile

@sithhell

This comment has been minimized.

Copy link
Member

commented Sep 19, 2014

This should be fixed now. Please verify.

hkaiser added a commit that referenced this issue Sep 20, 2014

hkaiser added a commit that referenced this issue Sep 20, 2014

@hkaiser

This comment has been minimized.

Copy link
Member

commented Sep 23, 2014

Closing this... Feel free to reopen, if needed.

@hkaiser hkaiser closed this Sep 23, 2014

hkaiser added a commit that referenced this issue Sep 29, 2014

Fixing problems with HPX_PREFIX, this is related to #1252: HPX_PREFIX…
… is too fragile

(cherry picked from commit 39f1382)

Conflicts:
	src/hpx_init.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.