hard-coded paths in .configure

Post Reply
toddrme2178
Posts: 1
Joined: Sat Jun 21, 2014 6:49 am

hard-coded paths in .configure

Post by toddrme2178 »

Hi,

I am trying to create an RPM package of neuron for openSUSE. I have run into several issues with configure, however.

The first has to do with paths. These are hard-coded in many places, which means libraries installed in standard directories will not be found. Here is one example, startling at line 6787:

Code: Select all

	
	MUSIC_LIBLA="$with_music/lib/libmusic.la"
	MUSIC_INCDIR="$with_music/include"
	MUSIC_LIBDIR="$with_music/lib"
This will work on a 32bit system. However, on 64bit systems, it should be something more like this:

Code: Select all

	
	MUSIC_LIBLA="$with_music/lib64/libmusic.la"
	MUSIC_INCDIR="$with_music/include"
	MUSIC_LIBDIR="$with_music/lib64"
This could be simplified further by just using the --includedir and --libdir arguments to .configure (which defaults to the values you currently use anyway, and is handled automatically by RPM):

Code: Select all

	
	MUSIC_LIBLA="$libdir/libmusic.la"
	MUSIC_INCDIR="$includedir"
	MUSIC_LIBDIR="$libdir"
This seems to happen in quite a few places. So far I have also found it with metis and interviews handling, but that is as far as I have gotten with the configuration.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: hard-coded paths in .configure

Post by hines »

Yes, It would be nice to be able to assume a standard place for the several packages that NEURON optionally uses and includedir and libdir is a good first choice. However, it is necessary that
the builder also be able to specify the locations of the packages. In the case of MUSIC, the makefiles need to know MUSIC_LIBLA, MUSIC_INCDIR, and MUSIC_LIBDIR in order to succeed.
You can see in the nrn/m4/withmpi.m4 file in AC_DEFUN([AC_NRN_MUSIC],[
how I wrongly assumed the specfication of the argument to --with-music would be sufficient to determine all three. One possibility would be to recode the AC_DEFUN so that the default of
--with-music
i.e. if test "$with_music" = "yes"
would define
MUSIC_LIBLA=$libdir/libmusic.la
MUSIC_INCDIR=$incdir
MUSIC_LIBDIR=$libdir
but then if with_music was not equal to "no", it would use my current default method. But in any case if either $MUSIC_LIBLA or $MUSIC_INCDIR or $MUSIC_LIBDIR was pre-defined (eg on the
configure command line) then that define would take precedence. This is similar to the --with-nrnpython case where configure makes heroic attempts to figure out various location but often it ends up
that the user has to explicitly specify one or more of
PYLIB
PYLIBDIR
PYLIBLINK
PYINCDIR
Post Reply