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

Fortran files do not build without -fPIC #31

Closed
nalimilan opened this issue Dec 9, 2013 · 4 comments
Closed

Fortran files do not build without -fPIC #31

nalimilan opened this issue Dec 9, 2013 · 4 comments

Comments

@nalimilan
Copy link
Contributor

When building the Julia RPM package, I noticed openlibm does not build if CFLAGS is set and it does not include -fPIC. I think this flag should be passed explicitly everywhere it may be needed (or always added to CFLAGS), since packagers should not have to worry about this.

When building Julia as a whole, passing -fPIC means that executables will also use this flag. And I need to set CFLAGS to respect the ditribution's defaults.

The log is:

checking whether gcc and cc understand -c and -o together... yes
checking for ar... ar
checking the archiver (ar) interface... ar -rcs libopenlibm-extras.a amos/d1mach.f.o amos/zabs.f.o amos/zasyi.f.o amos/zbesk.f.o amos/zbknu.f.o amos/zexp.f.o amos/zmlt.f.o amos/zshch.f.o amos/zuni1.f.o amos/zunk2.f.o amos/dgamln.f.o amos/zacai.f.o amos/zbesh.f.o amos/zbesy.f.o amos/zbuni.f.o amos/zkscl.f.o amos/zrati.f.o amos/zsqrt.f.o amos/zuni2.f.o amos/zuoik.f.o amos/i1mach.f.o amos/zacon.f.o amos/zbesi.f.o amos/zbinu.f.o amos/zbunk.f.o amos/zlog.f.o amos/zs1s2.f.o amos/zuchk.f.o amos/zunik.f.o amos/zwrsk.f.o amos/xerror.f.o amos/zairy.f.o amos/zbesj.f.o amos/zbiry.f.o amos/zdiv.f.o amos/zmlri.f.o amos/zseri.f.o amos/zunhj.f.o amos/zunk1.f.o Faddeeva/Faddeeva.c.o
gfortran -shared amos/d1mach.f.o amos/zabs.f.o amos/zasyi.f.o amos/zbesk.f.o amos/zbknu.f.o amos/zexp.f.o amos/zmlt.f.o amos/zshch.f.o amos/zuni1.f.o amos/zunk2.f.o amos/dgamln.f.o amos/zacai.f.o amos/zbesh.f.o amos/zbesy.f.o amos/zbuni.f.o amos/zkscl.f.o amos/zrati.f.o amos/zsqrt.f.o amos/zuni2.f.o amos/zuoik.f.o amos/i1mach.f.o amos/zacon.f.o amos/zbesi.f.o amos/zbinu.f.o amos/zbunk.f.o amos/zlog.f.o amos/zs1s2.f.o amos/zuchk.f.o amos/zunik.f.o amos/zwrsk.f.o amos/xerror.f.o amos/zairy.f.o amos/zbesj.f.o amos/zbiry.f.o amos/zdiv.f.o amos/zmlri.f.o amos/zseri.f.o amos/zunhj.f.o amos/zunk1.f.o Faddeeva/Faddeeva.c.o  -o libopenlibm-extras.so
/usr/bin/ld: amos/d1mach.f.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
amos/d1mach.f.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [libopenlibm-extras.so] Error 1
@vtjnash
Copy link
Contributor

vtjnash commented Dec 9, 2013

The C files / CFLAGS are handled correctly. The problem here is with fortran files / FFLAGS.

@nalimilan
Copy link
Contributor Author

Indeed, I set both CFLAGS and FFLAGS.

@ViralBShah
Copy link
Member

We should just make -fPIC always be there by default. Will fix this once I split amos and Faddeeva out into their own packages.

@staticfloat
Copy link
Contributor

This should now be fixed, ever since JuliaMath/openspecfun@20242c3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants