JuliaMath / openspecfun

A collection of special mathematical functions
Other
35 stars 20 forks source link

Look for headers in $(prefix)/include/openlibm #13

Closed nalimilan closed 6 years ago

nalimilan commented 10 years ago

This is required to build with USE_OPENLIBM=1. Cf. https://github.com/JuliaLang/openlibm/commit/eb2f4d4b44e6ffaede3057d2cb6c6bae77de863f

nalimilan commented 10 years ago

Currently there is this in Make.inc

ifeq ($(USE_OPENLIBM),1)
override CPPFLAGS_add += -DUSE_OPENLIBM -I$(OPENLIBM_HOME)/src -I$(OPENLIBM_HOME)/include
endif

This doesn't sound very correct since it expects we use openlibm from its source tree. I'd rather base everything on what is installed, since anyway Julia now installs everything using the same directory tree as the final one into $(build). So ideally I'd like to see something like this:

ifeq ($(USE_OPENLIBM),1)
override CFLAGS_add += -I$(prefix)/include/openlibm
override CPPFLAGS_add += -DUSE_OPENLIBM -I$(prefix)/include/openlibm
endif

But I've not been able to figure out what's the standard way of allowing users to override the include path in case openlibm is not in $(prefix)/include/openlibm. Do you have any idea?

Other than that, it doesn't seem libopenspecfun.so is linked to openlibm, even with USE_OPENLIBM=1. ldd reports that it's linked to libm. I guess -lopenlibm is missing, which could easily be added. But how can we stop linking against libm? Should we?

ViralBShah commented 6 years ago

Since we look in $(includedir) now, I think that is sufficient.