|Deletions are marked like this.||Additions are marked like this.|
|Line 3:||Line 3:|
|Line 7:||Line 7:|
- Can you give me more info on GNU automake/autoconf/libtool?
- What are the dependencies of various files used in autoconf?
- Makefile.in, Makefile.am, configure.in, and configure are non-mergeable
- How can I start configure from scratch? (I screwed up miserably)
- How can I resolve "required directory does not exist" ?
- How can I resolve "*** No rule to make target `all'" ?
- How can I resolve "cannot find input file"?
- How can I resolve 'can't locate object method "path" via package "Request"'?
- How can I resolve "WARNING: `aclocal-1.6' is missing on your system" ?
- How can I resolve "version mismatch. This is automake 1.8.3 ..."
- How can I resolve "make: AR@: Command not found"?
- How can I resolve "make: RANLIB@: Command not found"? (MacOSX)
- How can I resolve "Makefile:...: *** missing separator. Stop."?
- How can I resolve "configure.in:26:error: possibly undefined macro: AC_PROG_LIBTOOL" ? (MacOSX)
- How can I resolve "Makefile not present in util direcotry"? (MacOSX)
- How can I resolve "Can't locate object method "path" via package "Autom4te..."?
- No target for 'install'
- libtool: link: cannot find the library `'
- I'm still getting unresolved variables, and things are just messed up!
1. Troubleshooting FAQ
1.1. Can you give me more info on GNU automake/autoconf/libtool?
The comprehensive info is read in a book GNU Autoconf, Automake, and Libtool. The book is on line.
Some web pages are useful: Simple examples are here and here. Bigger example is about writing Gnome application. here.
I created a directory which lists a project starting without autoconf but makefile and ended up with the full configured one. If you are inside MGH, then see /space/martinos/1/recon/tosa/autoconf directory. There is a steps.tar.gz file which contains every single step so that you can open it locally to see how it is done.
1.2. What are the dependencies of various files used in autoconf?
Here is the dependencies of various files:
Input files: /dev/acinclude.m4, /dev/configure.in, Makefile.am's and /dev/config/*. Output files: /dev/aclocal.m4, /dev/configure, /dev/config.h.in, /dev/config.h, Makefile.in's, Makefile's Usually you generate files in the following order: aclocal : acinclude.m4 and configure.in --> aclocal.m4 (macro replacing definitions) autoheader: aclocal.m4 and configure.in --> config.h.in automake : configure.in and Makefile.am's --> Makefile.in's autoconf : configure.in and aclocal.m4 --> configure configure : Makefile.in's --> Makefile's make : Makefile's and config.h --> project targets
Now you know what to do if some files are missing or producing complaints.
1.3. Makefile.in, Makefile.am, configure.in, and configure are non-mergeable
In order to avoid CVS do a stupid merge, Makefile.in, Makefile.am, configure.in, and configure are set non-mergeable. This setting is done in dev/CVS_ROOT/cvswrappers. You checkout this file and edit and check it in. Actual lines are as follows:
Makefile.am -m 'COPY' Makefile.in -m 'COPY' configure.in -m 'COPY' configure -m 'COPY'
You get the following message when CVS thinks merge being necessary:
U utils/Makefile.in cvs server: nonmergeable file needs merge cvs server: revision 1.6 from repository is now in utils/Makefile.in cvs server: file from working directory is now in .#Makefile.in.1.4
Therefore, you do not lose your version of non-mergeable files.
1.4. How can I start configure from scratch? (I screwed up miserably)
If you screwed up configure so badly, then you may want to clean up and start from scratch. If you were able to create Makefile's, then you can try the following:
$ cd $dev $ make distclean
This will remove all the cached information on autoconf. If this fails, just remove the entire dev directory and resync again.
Alternatively, the following set of commands will construct all of the files required of a fresh build:
$ cd $dev $ make distclean $ rm -rf autom4te.cache $ libtoolize --force $ autoreconf --force $ ./configure
The autoreconf --force command runs autoconf, autoheader, aclocal, automake, autopoint (formerly gettextize), and libtoolize (where appropriate) repeatedly to remake the GNU Build System files. The libtoolize --force command is necessary because autoreconf --force does not reliably execute libtoolize.
Note that this sequence of commands fixes many of the build problems described in this Wiki.
1.5. How can I resolve "required directory does not exist" ?
After cvs update . in dev, I tried to do make, but I get the following errors:
$ make cd . && /bin/sh /home/tosa/dev/config/missing --run aclocal-1.6 cd . && \ /bin/sh /home/tosa/dev/config/missing --run automake-1.6 --gnu Makefile Makefile.am:50: required directory ./utilscpp does not exist make: *** [Makefile.in] Error 1
This occured because while you were working, new directory was added. The command "cvs update ." does not add a new directory. Therefore, you have to do
$ cvs update -d utilscpp $ make cd . && /bin/sh /home/tosa/dev/config/missing --run autoconf /bin/sh ./config.status --recheck running /bin/sh ./configure --prefix=/usr/local/freesurfer/alpha --with-mni-dir=/usr/local/mni/1.3 --no-create --no-recursion configure: Setting System ... checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu ...
Note that autoconf automatically detected needing to run autoconf to recreate Makefile's.
1.6. How can I resolve "*** No rule to make target `all'" ?
When I did make, I get
Making all in utilscpp make: Entering directory `/home/tosa/dev/utilscpp' make: *** No rule to make target `all'. Stop. make: Leaving directory `/home/tosa/dev/utilscpp' make: *** [all-recursive] Error 1
This error usually means that there is no Makefile present in the directory it is making or Makefile is incompatible.
You can fix this by running config.status in dev directory:
$ ./config.status ... config.status: creating utilscpp/Makefile ...
If the system is MacOSX Panther, then go to another section.
1.7. How can I resolve "cannot find input file"?
When I did config.status, I get
config.status: error: cannot find input file: mri_make_density_map/Makefile.in
Usually this means that either 1) the directory is present but no files exist in the directory or 2) Makefile.in was not checked in by the developer who created this directory. In the fist case, you have to
$ rm -rf mri_make_density_map $ cvs update -d mri_make_density_map cvs server: Updating mri_make_density_map U mri_make_density_map/Makefile.am U mri_make_density_map/Makefile.in U mri_make_density_map/mri_make_density_map.c $ config.status ... config.status: creating mri_make_density_map/Makefile ...
In the second case, you have to generate it by running automake.
$ cd dev $ automake -v $ config.status
Make sure that you see mris_make_density_map/Makefile is generated in this case at automake line. Make sure that config.status should generate Makefile in mris_make_density_map directory in this case.
1.8. How can I resolve 'can't locate object method "path" via package "Request"'?
The exact error message is the following:
Can't locate object method "path" via package "Request" at /usr/share/autoconf/Autom4te/C4che.pm line 69, <GEN1> line 214. aclocal: autom4te failed with exit status: 1
It is really weird error message. It turned out that this is telling the fact that the cached one in dev/autom4te.cache is out of sync. What you should do is to remove autom4te.cache directory.
1.9. How can I resolve "WARNING: `aclocal-1.6' is missing on your system" ?
When I tried make on SuSE 9.1 system, I get the following message:
$ make cd . && /bin/sh /space/birn/12/users/tosa/jupiter/dev/config/missing --run aclocal-1.6 /space/birn/12/users/tosa/jupiter/dev/config/missing: line 46: aclocal-1.6: command not found WARNING: `aclocal-1.6' is missing on your system. You should only need it if you modified `acinclude.m4' or `configure.in'. You might want to install the `Automake' and `Perl' packages. Grab them from any GNU archive site.
This is because SuSE 9.1 has a newer version of aclocal. This can be fixed by generating a new aclocal.m4 and use it to generate all the files:
$ aclocal $ autoheader $ automake $ autoconf $ config.status
1.10. How can I resolve "version mismatch. This is automake 1.8.3 ..."
Here is the error emitted on jupiter (SuSE 9.1):
jupiter/dev> automake configure.in:14: version mismatch. This is Automake 1.8.3, configure.in:14: but the definition used by this AM_INIT_AUTOMAKE configure.in:14: comes from Automake 1.6.3. You should recreate configure.in:14: aclocal.m4 with aclocal and run automake again. /usr/share/automake-1.8/am/depend2.am: am__fastdepCC does not appear in AM_CONDITIONAL /usr/share/automake-1.8/am/depend2.am: am__fastdepCC does not appear in AM_CONDITIONAL /usr/share/automake-1.8/am/depend2.am: am__fastdepCC does not appear in AM_CONDITIONAL
SuSE9.1 has new version of automake (not autmake 1.6.3). Thus you have to recreate new aclocal.m4 (which consists of m4 macros for this particular system but not the one checked in). Therefore you need to do
$ aclocal $ automake $ autoconf $ configure ...
1.11. How can I resolve "make: AR@: Command not found"?
I got the following error:
make: Entering directory `/autofs/space/lyon_001/fsdev/work/tosa/dev/utils' Unmatched `. /home/tosa/dev/utils>rm -f libutils.a /home/tosa/dev/utils>make: AR@: Command not found make:: Too many arguments.
This is due to the fact that the bad Makefile.in (where @AR@ was not substituded) was checked in. Autoconf can recreate the correct Makefile.in by doing the following:
$ cd utils $ rm Makefile.in $ make cd .. && \ /bin/sh /space/lyon/1/fsdev/work/tosa/dev/config/missing --run automake-1.6 --gnu utils/Makefile cd .. && /bin/sh ./config.status utils/Makefile config.status: creating utils/Makefile
Please check in the corrected Makefile.in.
1.12. How can I resolve "make: RANLIB@: Command not found"? (MacOSX)
This happens on MacOSX Panther, because fink version of configuration binaries, aclocal, automake, etc. are not compatible with freesurfer build. Start your shell without syncing /sw/bin/init.csh. Panther version of aclocal, automake, etc lives in /usr/bin.
1.13. How can I resolve "Makefile:...: *** missing separator. Stop."?
Here is the actual error message I got:
Make: Entering directory `/autofs/space/tensor_004/users/fischl/dev/utils/test' Makefile:561: *** missing separator. Stop.
If I look at the offending Makefile, I find
.c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no \ @am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ @am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) \ @am__fastdepCC_FALSE@ $(COMPILE) -c $<
These lines should have been substituded (using the value of am_fastdepCC_TRUE and am_fastdepCC_FALSE) as
.c.o: source='$<' object='$@' libtool=no \ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ $(CCDEPMODE) $(depcomp) \ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
Note that the variable is am__fastdepCC_TRUE, which implies that automake did not do the substitution. Since automake is the one creates Makefile.in, this is most likely produced by a bad Makefile.in check-in. Since Makefile is broken, you have to remove bad Makefile and Makefile.in. Then, you recreate Makefile.in and Makefile assuming that Makefile.am is correct.
$ rm Makefile $ rm Makefile.in $ cd $(topsrc_dir) $ automake <---- in order to create Makefile.in $ config.status <---- in order to create Makefile from new Makefile.in
If still not working, Makefile.am is a suspect. Make sure that the content is correct.
1.14. How can I resolve "configure.in:26:error: possibly undefined macro: AC_PROG_LIBTOOL" ? (MacOSX)
This occurs on MacOSX Panther. It turned out that Fink does not install libtool package. The easiest is not to source /sw/init.tcsh and start a new shell window. Make sure that your aclocal is coming from /usr/bin, not from /sw/bin. After aclocal to recreate aclocal.m4, you should edit aclocal.m4 described in the next item.
1.15. How can I resolve "Makefile not present in util direcotry"? (MacOSX)
This happens on MacOSX due to aclocal incompatibility.
1. edit aclocal.m4 comment out the following line AC_CHECK_TOOL(AR, ar, false) to # AC_CHECK_TOOL(AR, ar, false) 2. automake, autoconf, config.status
1.16. How can I resolve "Can't locate object method "path" via package "Autom4te..."?
This is a really weird message, but it is saying that /dev/autom4te.cache directory is bad. Please remove /dev/autom4te.cache directory. Then do automake, autoconf, config.status.
1.17. No target for 'install'
Make sure the Makefile is present. You may be missing the Makefile.am, Makefile.in, or Makefile. If the Makefile.am is present, this is probably a new directory that is ready to be built but is not in your configure. Make sure you have run cvs update -d, then run head config.log and note the paramters you passed to configure. Then run autoconf and then ./configure with the parameters you noted before, but without --no-recursion and --no-create. This should create the Makefile in the given directory.
1.18. libtool: link: cannot find the library `'
This happens on an OS X machine when trying to link dynamic library files that have associated .la files with -framework in the dependency_libs command. For example, for libqt-mt.dylib, there's an associated libqt-mt.la in the same dir, which contains the following line:
dependency_libs=' -framework Carbon -framework QuickTime -lz -framework OpenGL -framework AGL '
The -framework option is incompatible with libtool, so just comment out the line (in the file $QTDIR/lib/libqt-mt.la).
1.19. I'm still getting unresolved variables, and things are just messed up!
If your installation has newer versions of the autotools you may need to rebuild everything from scratch, including the libtool scripts that are in the archive. To do this, from dev/:
$ head config.log ---- note the configure options you used $ make distclean $ rm -rf autom4te.cache $ libtoolize --force $ autoreconf $ aclocal $ automake $ autoconf $ ./configure ... ---- use options from before, but without --no-recursion and --no-create