astro-informatics / s2let-archive

Fast wavelet transforms on the sphere
http://astro-informatics.github.io/s2let
GNU General Public License v2.0
13 stars 8 forks source link

missing shared library: ./lib/libs2let.so #1

Closed pwschuck closed 4 years ago

pwschuck commented 8 years ago

Hi Boris and Jason,

I was able to build and run the test for sh2let with the latest ssht library. I am now trying to build the dynamic library for idl

Here is what I get make dylib

icc -shared -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -o ./lib/libs2let.so ./src/main/c/s2let_transform_axisym_lm.o ./src/main/c/s2let_transform_axisym_mw.o ./src/main/c/s2let_alloc.o ./src/main/c/s2let_helper.o ./src/main/c/s2let_analysis.o ./src/main/c/s2let_synthesis.o ./src/main/c/s2let_idl_mw.o ./src/main/c/s2let_lm.o ./src/main/c/s2let_math.o ./src/main/c/s2let_mw.o ./src/main/c/s2let_tiling.o ./src/main/c/s2let_hpx.o ./src/main/c/s2let_transform_axisym_hpx.o ./src/main/c/s2let_idl_hpx.o ./src/main/f90/s2let_hpx.o -L./lib -ls2let -lc -L../so3/lib/c -lso3 -L/usr/local/sphwvlts/ssht/lib/c -lssht -L/lib -lfftw3 -lm -L/data/software/HEALPix/HEALPix_3.30/lib -lhealpix -fopenmp
./lib/libs2let.so: file not recognized: File truncated make: *\ [lib/libs2let.so] Error 1

i don't see a def in the makefile for libs2let.so there is an archive there ls ./lib/ libs2let.a

I have made some minor? changes in the makefile (but i don't think this is the issue)

diff makefile makefile.orig 29,31c29,30 < CC = icc < # note pete: added -O3

< OPT = -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\"

CC = gcc OPT = -Wall -g -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"git rev-parse HEAD\" 34c33

< FCC = ifort

FCC = gfortran 36d34 < OPTF90 = -O3 -fPIC 43,44c41 < # DYLIBCMD = icc -flat_namespace -undefined suppress

< DYLIBCMD = icc -shared

DYLIBCMD = cc -flat_namespace -undefined suppress 53d49 < HPXOPT = -fopenmp 132d127 < 185,186c180 < # LDFLAGS+= -lgfortran -fopenmp

< LDFLAGS+= -fopenmp

  LDFLAGS+= -lgfortran -fopenmp

264d257 < #note pete: no matlab so changed order of build 266c259

< all: lib mw_bin tidy matlab tidy

all: lib matlab mw_bin tidy 279d271 < # note pete: moved LDFLAGS to end so that libm is linked last to engage intel math libraries first 281c273

< $(DYLIBCMD) $(FFLAGS) -o $(S2LETLIB)/lib$(S2LETLIBNM).$(DYLIBEXT) $(S2LETOBJS) $(LDFLAGS)

  $(DYLIBCMD) $(FFLAGS) $(LDFLAGS) -o $(S2LETLIB)/lib$(S2LETLIBNM).$(DYLIBEXT) $(S2LETOBJS)

thanks,

-- Pete

ixkael commented 8 years ago

Hi Pete,

This is strange, it looks like some of the files are corrupted, but the command seems OK. The command that works for me is:

g++ -flat_namespace -dynamiclib -undefined suppress -I/usr/local/include -I/Users/bl/Dropbox/Wavelets/ssht/include/c -I../so3/include/c -I./include -I/Users/bl/Dropbox/itt/idl/external/include -I/Users/bl/Dropbox/software/Healpix_3.20/include -I/usr/local/include -o ./lib/libs2let.dylib ./src/main/c/s2let_transform_axisym_lm.o ./src/main/c/s2let_transform_axisym_mw.o ./src/main/c/s2let_alloc.o ./src/main/c/s2let_helper.o ./src/main/c/s2let_analysis.o ./src/main/c/s2let_synthesis.o ./src/main/c/s2let_idl_mw.o ./src/main/c/s2let_lm.o ./src/main/c/s2let_math.o ./src/main/c/s2let_mw.o ./src/main/c/s2let_tiling.o ./src/main/c/s2let_hpx.o ./src/main/c/s2let_transform_axisym_hpx.o ./src/main/c/s2let_idl_hpx.o ./src/main/f90/s2let_hpx.o ./src/main/c/s2let_fits.o -L./lib -ls2let -lc -L../so3/lib/c -lso3 -L/Users/bl/Dropbox/Wavelets/ssht/lib/c -lssht -L/usr/local/lib -lfftw3 -lm -L/Users/bl/Dropbox/software/Healpix_3.20/lib -lhealpix -lgfortran -fopenmp -L/usr/local/lib -lcfitsio

which is very similar to what you have. The only sensible difference is the compiler but I would say "icc -shared" should work. Maybe the order in the rest of the command is different? Could you please try to "make clean lib dylib"?

pwschuck commented 8 years ago

I changed 'icc' to 'ld' which doesn't work either.....

thanks,

-- Pete

make clean lib dylib rm -f ./src/main/c/.o rm -f ./src/test/c/.o rm -f ./src/main/f90/.o rm -f ./src/main/matlab/.o rm -f ~ rm -f ./lib/libs2let. rm -f ./src/main/matlab/_mex.mexa64 rm -f ./bin/ icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_transform_axisym_lm.c -o src/main/c/s2let_transform_axisym_lm.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_transform_axisym_mw.c -o src/main/c/s2let_transform_axisym_mw.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_alloc.c -o src/main/c/s2let_alloc.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_helper.c -o src/main/c/s2let_helper.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_analysis.c -o src/main/c/s2let_analysis.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_synthesis.c -o src/main/c/s2let_synthesis.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_idl_mw.c -o src/main/c/s2let_idl_mw.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_lm.c -o src/main/c/s2let_lm.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_math.c -o src/main/c/s2let_math.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_mw.c -o src/main/c/s2let_mw.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_tiling.c -o src/main/c/s2let_tiling.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_hpx.c -o src/main/c/s2let_hpx.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_transform_axisym_hpx.c -o src/main/c/s2let_transform_axisym_hpx.o icc -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -c ./src/main/c/s2let_idl_hpx.c -o src/main/c/s2let_idl_hpx.o ifort -O3 -fPIC -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -fopenmp -c src/main/f90/s2let_hpx.f90 -o src/main/f90/s2let_hpx.o ar -r ./lib/libs2let.a ./src/main/c/s2let_transform_axisym_lm.o ./src/main/c/s2let_transform_axisym_mw.o ./src/main/c/s2let_alloc.o ./src/main/c/s2let_helper.o ./src/main/c/s2let_analysis.o ./src/main/c/s2let_synthesis.o ./src/main/c/s2let_idl_mw.o ./src/main/c/s2let_lm.o ./src/main/c/s2let_math.o ./src/main/c/s2let_mw.o ./src/main/c/s2let_tiling.o ./src/main/c/s2let_hpx.o ./src/main/c/s2let_transform_axisym_hpx.o ./src/main/c/s2let_idl_hpx.o ./src/main/f90/s2let_hpx.o ar: creating ./lib/libs2let.a ld -shared -I/include -I/usr/local/sphwvlts/ssht/include/c -I../so3/include/c -I./include -I/external/include -I/data/software/HEALPix/HEALPix_3.30/include -o ./lib/libs2let.so ./src/main/c/s2let_transform_axisym_lm.o ./src/main/c/s2let_transform_axisym_mw.o ./src/main/c/s2let_alloc.o ./src/main/c/s2let_helper.o ./src/main/c/s2let_analysis.o ./src/main/c/s2let_synthesis.o ./src/main/c/s2let_idl_mw.o ./src/main/c/s2let_lm.o ./src/main/c/s2let_math.o ./src/main/c/s2let_mw.o ./src/main/c/s2let_tiling.o ./src/main/c/s2let_hpx.o ./src/main/c/s2let_transform_axisym_hpx.o ./src/main/c/s2let_idl_hpx.o ./src/main/f90/s2let_hpx.o -L./lib -ls2let -lc -L../so3/lib/c -lso3 -L/usr/local/sphwvlts/ssht/lib/c -lssht -L/lib -lfftw3 -lm -L/data/software/HEALPix/HEALPix_3.30/lib -lhealpix -fopenmp ./lib/libs2let.so: file not recognized: File truncated make: *\ [lib/libs2let.so] Error 1

On 11/19/2015 01:29 PM, Boris Leistedt wrote:

Hi Pete,

This is strange, it looks like some of the files are corrupted, but the command seems OK. The command that works for me is:

g++ -flat_namespace -dynamiclib -undefined suppress -I/usr/local/include -I/Users/bl/Dropbox/Wavelets/ssht/include/c -I../so3/include/c -I./include -I/Users/bl/Dropbox/itt/idl/external/include -I/Users/bl/Dropbox/software/Healpix_3.20/include -I/usr/local/include -o ./lib/libs2let.dylib ./src/main/c/s2let_transform_axisym_lm.o ./src/main/c/s2let_transform_axisym_mw.o ./src/main/c/s2let_alloc.o ./src/main/c/s2let_helper.o ./src/main/c/s2let_analysis.o ./src/main/c/s2let_synthesis.o ./src/main/c/s2let_idl_mw.o ./src/main/c/s2let_lm.o ./src/main/c/s2let_math.o ./src/main/c/s2let_mw.o ./src/main/c/s2let_tiling.o ./src/main/c/s2let_hpx.o ./src/main/c/s2let_transform_axisym_hpx.o ./src/main/c/s2let_idl_hpx.o ./src/main/f90/s2let_hpx.o ./src/main/c/s2let_fits.o -L./lib -ls2let -lc -L../so3/lib/c -lso3 -L/Users/bl/Dropbox/Wavelets/ssht/lib/c -lssht -L/usr/local/lib -lfftw3 -lm -L/Users/bl/Dropbox/software/Healpix_3.20/lib -lhealpix -lgfortran -fopenmp -L/usr/local/lib -lcfitsio

which is very similar to what you have. The only sensible difference is the compiler but I would say "icc -shared" should work. Maybe the order in the rest of the command is different? Could you please try to "make clean lib dylib"?

— Reply to this email directly or view it on GitHub https://github.com/astro-informatics/s2let/issues/1#issuecomment-158147599.

Pete Schuck peter.schuck@nasa.gov Room 250, Building 21 Space Weather Laboratory, Code 674 Heliophysics Science Division NASA Goddard Space Flight Center 8800 Greenbelt Rd. Greenbelt, MD 20771

Work: (301) 286-3008 Cell: (240) 393-9607 fax: (301) 286-5348


Nullius in verba

For the materialist, science is what teaches us what to believe. For the empiricist, science is more nearly what teaches us how to give up our beliefs. --- Bas van Fraassen

Because the truth is important --- Jordan Schuck (Age 7)

ixkael commented 8 years ago

Honestly I don't understand this error. Maybe the compiler/linker is trying to access the file in parallel. Maybe try with "-j 1" ?

pwschuck commented 8 years ago

Hi Boris,

I got it to work nominally!

I removed -L$(S2LETLIB) -l$(S2LETLIBNM) from LDFLAGS ... by creating a new MYLDFLAGS for the dynamic library

at that point it worked!

But... there was still a failure to load the dynamic library in idl with

s2let_axisym_mw_wav_analysis_real

L INT = 128 B INT = 3 J_MIN INT = 2 J_MAX INT = 5 WAVTYPE INT = 1 % CALL_EXTERNAL: Error loading sharable executable. Symbol: s2let_idl_transform_axisym_wav_analysis_mw_real, File = /usr/local/sphwvlts/s2let//lib/libs2let.so /usr/local/sphwvlts/s2let//lib/libs2let.so: undefined symbol: __intel_cpu_feature_indicator_x % Execution halted at: S2LET_AXISYM_MW_WAV_ANALYSIS_REAL 70 /usr/local/sphwvlts/s2let/src/main/idl/s2let_axisym_mw_wav_analysis_real.pro % S2LET_DEMO1 37 /usr/local/sphwvlts/s2let/src/main/idl/s2let_demo1.pro % $MAIN$

adding -lirc seems to have resolved this. However it's my understanding that this may be caused by a kerfuffle between the compiler libraries and the load libraries. I'm looking into it.

However s2let_demo produced 6 very pretty images.

diff of my makefile attached

-- Pete

On 11/19/2015 01:44 PM, Boris Leistedt wrote:

Honestly I don't understand this error. Maybe the compiler/linker is trying to access the file in parallel. Maybe try with "-j 1" ?

— Reply to this email directly or view it on GitHub https://github.com/astro-informatics/s2let/issues/1#issuecomment-158152113.

Pete Schuck peter.schuck@nasa.gov Room 250, Building 21 Space Weather Laboratory, Code 674 Heliophysics Science Division NASA Goddard Space Flight Center 8800 Greenbelt Rd. Greenbelt, MD 20771

Work: (301) 286-3008 Cell: (240) 393-9607 fax: (301) 286-5348


Nullius in verba

For the materialist, science is what teaches us what to believe. For the empiricist, science is more nearly what teaches us how to give up our beliefs. --- Bas van Fraassen

Because the truth is important --- Jordan Schuck (Age 7)

diff makefile makefile.pete 30,31c30,31 < # note pete: added -O3

< OPT = -Wall -fPIC -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\"

note pete add -O3

OPT = -Wall -g -O3 -fopenmp -DS2LET_VERSION=\"1.1b1\" -DS2LET_BUILD=\"svnversion -n .\" 36c36

< OPTF90 = -O3 -fPIC

OPTF90 = -O3 43,44c43,44 < # DYLIBCMD = icc -flat_namespace -undefined suppress

< DYLIBCMD = ifort -shared

DYLIBCMD = icc -flat_namespace -undefined suppress DYLIBCMD = icc 132,133d131 < MYLDFLAGS = -lc -L$(SO3LIB) -l$(SO3LIBNM) -L$(SSHTLIB) -l$(SSHTLIBNM) -L$(FFTWLIB) -l$(FFTWLIBNM) -lirc -lm < 266d263 < #note pete: no matlab so changed order of build 281,284c278,279 < # note pete: moved LDFLAGS to end so that libm is linked last to engage intel math libraries first < $(S2LETLIB)/lib$(S2LETLIBNM).$(DYLIBEXT): $(S2LETOBJS)# < $(DYLIBCMD) $(FFLAGS) $(S2LETOBJS) -o $(S2LETLIB)/lib$(S2LETLIBNM).$(DYLIBEXT) $(MYLDFLAGS)

< # $(DYLIBCMD) $(FFLAGS) -o $(S2LETLIB)/lib$(S2LETLIBNM).$(DYLIBEXT) $(S2LETOBJS) $(LDFLAGS)

$(S2LETLIB)/lib$(S2LETLIBNM).$(DYLIBEXT): $(S2LETOBJS) $(DYLIBCMD) $(FFLAGS) -o $(S2LETLIB)/lib$(S2LETLIBNM).$(DYLIBEXT) $(S2LETOBJS) $(LDFLAGS)

ixkael commented 8 years ago

Hi Pete,

Glad to know it worked! Yes getting S2LET to work in IDL can be tricky, thanks for attaching your makefile