Git Product home page Git Product logo

Comments (10)

gbernstein avatar gbernstein commented on May 27, 2024

Yikes, this is the nightmare scenario where we have to pull more and more of Boost guts into our repo in order to freeze the random number version. Let's hope that pulling in one more file is sufficient and there are not long tentacles of include files needed…

On Apr 2, 2012, at 10:26 AM, rmjarvis wrote:

On at least two systems (Mandeep's and one of Mike's), there are errors compiling pysrc/Random.cpp.

g++ -o pysrc/.obj/Random.os -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -fPIC -Iinclude/galsim -Iinclude -I/home/mjarvis/include -I/usr/local/cfitsio/include -I/usr/local/fftw/include -I/usr/include/python2.6 -I/usr/local/numpy/lib64/python2.6/site-packages/numpy/core/include pysrc/Random.cpp
In file included from include/galsim/Random.h:23,
                from pysrc/Random.cpp:2:
include/galsim/boost1_48_0.random/mersenne_twister.hpp:493: error: a function call cannot appear in a constant-expression
include/galsim/boost1_48_0.random/mersenne_twister.hpp:493: error: a function call cannot appear in a constant-expression
include/galsim/boost1_48_0.random/mersenne_twister.hpp:494: error: a function call cannot appear in a constant-expression
include/galsim/boost1_48_0.random/mersenne_twister.hpp:494: error: a function call cannot appear in a constant-expression
include/galsim/boost1_48_0.random/mersenne_twister.hpp:495: error: a function call cannot appear in a constant-expression
include/galsim/boost1_48_0.random/mersenne_twister.hpp:495: error: template argument 6 is invalid
include/galsim/boost1_48_0.random/mersenne_twister.hpp:495: error: template argument 8 is invalid
include/galsim/boost1_48_0.random/mersenne_twister.hpp:495: error: template argument 10 is invalid
include/galsim/boost1_48_0.random/mersenne_twister.hpp:495: error: template argument 12 is invalid
include/galsim/boost1_48_0.random/mersenne_twister.hpp:495: error: template argument 14 is invalid
include/galsim/boost1_48_0.random/mersenne_twister.hpp:495: error: invalid type in declaration before ‘;’ token
scons: *** [pysrc/.obj/Random.os] Error 1

I think it is probably due to a mismatch of the version 1.48 boost files with whatever the other installed boost is, since the lines in question involve the UINT64_C macro, which is defined in boost/cstdint.hpp, and this is one of the files that Gary didn't port over into our boost1_48_0.random mirror. So I'm going to start by trying to copy over this and all other low level boost files that Gary left to the installed boost, so our mirror will be completely self-contained. Hopefully this will solve the problem...


Reply to this email directly or view it on GitHub:
#63

from galsim.

rmandelb avatar rmandelb commented on May 27, 2024

Yuck. What you suggested seems worth a try, but as Gary said, we don't want to go too crazy with adding more and more boost files.

Mike, out of curiosity, is your system on which this fails similar in setup to Mandeep's system?

from galsim.

rmjarvis avatar rmjarvis commented on May 27, 2024

They're both RHEL, but I think the problem is that the boost version is 1.41 on mine. I'm guessing Mandeep's must be similarly old. The cstdint.hpp file changed substantially between 1.41 and 1.48. Not sure of the exact version where it changed. Anyway, I copied that over and it works on my system now. Here is the commit:

2949788

Not sure why it didn't link here automatically.

It looks more substantial than it is. I added cstdint.hpp as I said. I also deleted some files that were duplicates in both the random/ directory and random/detail. The ones in random/detail are the only ones that were being used, and that's really the right place for them anyway, since it mirrors boost's directory structure. So I deleted the extraneous ones.

from galsim.

rmjarvis avatar rmjarvis commented on May 27, 2024

Mandeep, can you please do the following to test that this fixes the problem for you too:

git pull
git checkout -t 'origin/#63'
scons

If this all works, let me know. Then you can return to the main branch with

git checkout master

from galsim.

rmandelb avatar rmandelb commented on May 27, 2024

FWIW, I did not have this problem, but I just confirmed that your fix doesn't break anything for me (possibly useful info since I have a later boost, 1.49?).

from galsim.

rmandelb avatar rmandelb commented on May 27, 2024

I just realized Mandeep may not have gotten Mike's message above (people are not automatically subscribed to comments on issues unless they either respond to the issue or explicitly subscribe). So, I'm going to try to bring him in explicitly:

@mssgill , can you please click on the link to go to this issue on github, and see Mike's request? (2 comments above this one)

from galsim.

mssgill avatar mssgill commented on May 27, 2024

Thx Mike + Rachel- well - i think all has worked out, now, i copy the tail-end of the details below, and there are no errors -- i don't see a binary, either in the GalSim dir, or the galsim or bin subdirs, but let me look back at how to run the actual main code..

...
g++ -o pysrc/.obj/Random.os -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -fPIC -Iinclude/galsim -Iinclude -I/usr/include/python2.6 -I/usr/lib/pymodules/python2.6/numpy/core/include pysrc/Random.cpp
g++ -o galsim/_galsim.so -Wl,-rpath=/home/m/fizzAndAstro/great3/GalSim/lib -fopenmp -Wl,-rpath=/home/m/fizzAndAstro/great3/GalSim/lib -shared pysrc/.obj/module.os pysrc/.obj/Bounds.os pysrc/.obj/Shear.os pysrc/.obj/Image.os pysrc/.obj/SBProfile.os pysrc/.obj/SBPixel.os pysrc/.obj/Random.os -Llib -L/usr/lib -lboost_python -lcfitsio -lfftw3 -ltmv -lpython2.6 -lssl -lcrypto -lz -lpthread -ldl -lutil -lgalsim
scons: done building targets.

from galsim.

rmandelb avatar rmandelb commented on May 27, 2024

In the install file:

Once you have a successful build, you can install the GalSim library, python modules, and header files into standard locations (like /usr/local and your Python site-packages directory) with

scons install
or
sudo scons install

If you want to install into a different location, the prefix for the library and header files can
be specified with PREFIX=, and the location for the python modules can be specified
with PYPREFIX=. So the command would be

scons install PREFIX= PYPREFIX=

from galsim.

rmandelb avatar rmandelb commented on May 27, 2024

If you want to be able to run some of the example code, you'll also need to do

scons examples

and

sudo scons install examples

which would allow you to do some of the things on

https://github.com/GalSim-developers/GalSim/wiki/Examples:-getting-started-with-SBprofile-and-hsm

from galsim.

mssgill avatar mssgill commented on May 27, 2024

hi Rachel- all following compiles above executed successfully, now going to try some of the examples from that page you pointed to, thx- M

from galsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.