editeodoro / Bbarolo

Bbarolo is a 3D fitting tool to derive the kinematics of galaxies from emission-line observations.
http://editeodoro.github.io/Bbarolo/
GNU General Public License v2.0
32 stars 9 forks source link

configure/make difficulty finding wcslib #5

Closed kyleaoman closed 5 years ago

kyleaoman commented 6 years ago

I noticed a possible bug during configure on my system. It complained of being unable to find wcslib (specifically when it tests whether -lwcs finds wcss2p). I explicitly stated --with-wcslib=/home/koman (the library is at /astro/koman/lib), which failed again. Setting LDFLAGS=-L/astro/koman/lib AND specifying --with-wcslib=/astro/koman resolved the issue. Even though configure succeeded with this, the subsequent make failed in linking when unable to find a bunch of wcs library functions.

Here is the attempted linking step:

g++ -O2 -ftree-vectorize -fPIC -Wuninitialized -std=c++11 -fopenmp -flto -o BBarolo /astro/koman/code/Bbarolo/src/Build/bbarolo.o /astro/koman/code/Bbarolo/src/Build/header.o /astro/koman/code/Bbarolo/src/Build/param.o /astro/koman/code/Bbarolo/src/Build/stats.o /astro/koman/code/Bbarolo/src/Build/cube.o /astro/koman/code/Bbarolo/src/Build/search.o /astro/koman/code/Bbarolo/src/Build/image.o /astro/koman/code/Bbarolo/src/Build/object2D.o /astro/koman/code/Bbarolo/src/Build/object3D.o /astro/koman/code/Bbarolo/src/Build/objectgrower.o /astro/koman/code/Bbarolo/src/Build/utils.o /astro/koman/code/Bbarolo/src/Build/conv2D.o /astro/koman/code/Bbarolo/src/Build/smooth3D.o /astro/koman/code/Bbarolo/src/Build/galmod.o /astro/koman/code/Bbarolo/src/Build/galwind.o /astro/koman/code/Bbarolo/src/Build/galfit.o /astro/koman/code/Bbarolo/src/Build/galfit_min.o /astro/koman/code/Bbarolo/src/Build/galfit_errors.o /astro/koman/code/Bbarolo/src/Build/galfit_out.o /astro/koman/code/Bbarolo/src/Build/slitfit.o /astro/koman/code/Bbarolo/src/Build/spacepar.o /astro/koman/code/Bbarolo/src/Build/ringmodel.o /astro/koman/code/Bbarolo/src/Build/progressbar.o /astro/koman/code/Bbarolo/src/Build/ellprof.o /astro/koman/code/Bbarolo/src/Build/allocator.o /astro/koman/code/Bbarolo/src/Build/string.o /astro/koman/code/Bbarolo/src/Build/statistics.o /astro/koman/code/Bbarolo/src/Build/interpolation.o /astro/koman/code/Bbarolo/src/Build/converter.o /astro/koman/code/Bbarolo/src/Build/wcsUtils.o /astro/koman/code/Bbarolo/src/Build/BB_interface.o -L/usr/local/lib -lfftw3 -L/usr/local/lib -lcfitsio -L/astro/koman/lib -lwcs -lm -DHAVE_GNUPLOT -DHAVE_FFTW3 -DHAVE_PYTHON I experimented a bit and found that simply deleting the two -L/usr/local/lib arguments ended in a successful linking:

g++ -O2 -ftree-vectorize -fPIC -Wuninitialized -std=c++11 -fopenmp -flto -o BBarolo /astro/koman/code/Bbarolo/src/Build/bbarolo.o /astro/koman/code/Bbarolo/src/Build/header.o /astro/koman/code/Bbarolo/src/Build/param.o /astro/koman/code/Bbarolo/src/Build/stats.o /astro/koman/code/Bbarolo/src/Build/cube.o /astro/koman/code/Bbarolo/src/Build/search.o /astro/koman/code/Bbarolo/src/Build/image.o /astro/koman/code/Bbarolo/src/Build/object2D.o /astro/koman/code/Bbarolo/src/Build/object3D.o /astro/koman/code/Bbarolo/src/Build/objectgrower.o /astro/koman/code/Bbarolo/src/Build/utils.o /astro/koman/code/Bbarolo/src/Build/conv2D.o /astro/koman/code/Bbarolo/src/Build/smooth3D.o /astro/koman/code/Bbarolo/src/Build/galmod.o /astro/koman/code/Bbarolo/src/Build/galwind.o /astro/koman/code/Bbarolo/src/Build/galfit.o /astro/koman/code/Bbarolo/src/Build/galfit_min.o /astro/koman/code/Bbarolo/src/Build/galfit_errors.o /astro/koman/code/Bbarolo/src/Build/galfit_out.o /astro/koman/code/Bbarolo/src/Build/slitfit.o /astro/koman/code/Bbarolo/src/Build/spacepar.o /astro/koman/code/Bbarolo/src/Build/ringmodel.o /astro/koman/code/Bbarolo/src/Build/progressbar.o /astro/koman/code/Bbarolo/src/Build/ellprof.o /astro/koman/code/Bbarolo/src/Build/allocator.o /astro/koman/code/Bbarolo/src/Build/string.o /astro/koman/code/Bbarolo/src/Build/statistics.o /astro/koman/code/Bbarolo/src/Build/interpolation.o /astro/koman/code/Bbarolo/src/Build/converter.o /astro/koman/code/Bbarolo/src/Build/wcsUtils.o /astro/koman/code/Bbarolo/src/Build/BB_interface.o -lfftw3 -lcfitsio -L/astro/koman/lib -lwcs -lm -DHAVE_GNUPLOT -DHAVE_FFTW3 -DHAVE_PYTHON

A look at the ld docs was not illuminating as to why this would matter...

My environment in case it is relevant: env.log

editeodoro commented 6 years ago

Hi Kyle, I did not get if, in the configure step, you specified the full path where the libwcs.a is or the root path of the library. If the library is in /astro/koman/lib, you should specify --with-wcslib=/astro/koman/lib instead of --with-wcslib=/astro/koman

kyleaoman commented 6 years ago

I tried that as well, iirc it failed because then it cannot find the headers, which are at /astro/koman/include. Can the two locations be specified independently?

Kyle

On Tue, 20 Mar 2018, 09:16 EdT, notifications@github.com wrote:

Hi Kyle, I did not get if, in the configure step, you specified the full path where the libwcs.a is or the root path of the library. If the library is in /astro/koman/lib, you should specify --with-wcslib=/astro/koman/lib instead --with-wcslib=/astro/koman

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/editeodoro/Bbarolo/issues/5#issuecomment-374510963, or mute the thread https://github.com/notifications/unsubscribe-auth/AfaCn9Ycn3XwTHFT0q1Id-FJCLmP5Lbvks5tgLrJgaJpZM4SeeLn .

editeodoro commented 6 years ago

Ok, thanks for trying that! At the moment it is not possible to specify the two locations. I'll try to make the configure smarter and look for the headers also in the parent directories of the library .