ImagingDataCommons / libdicom

C library for reading DICOM files
https://libdicom.readthedocs.io
MIT License
16 stars 7 forks source link

can't run autogen.sh on ubuntu 20.04 #12

Closed pieper closed 2 years ago

pieper commented 2 years ago
$ ./autogen.sh 
*** WARNING: I am going to run 'configure' with no arguments.
*** If you wish to pass any to it, please specify them on the
*** './autogen.sh' command line.

autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force --warnings=no-portability -I m4
aclocal: warning: couldn't open directory 'm4': No such file or directory
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force --warnings=no-portability
configure.ac:60: error: possibly undefined macro: AC_DEFINE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
jcupitt commented 2 years ago

Hi @pieper, it should work, I see:

$ git clone git@github.com:hackermd/libdicom.git
Cloning into 'libdicom'...
...
$ cd libdicom/
$ git checkout dev 
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
Switched to a new branch 'dev'
$ ./autogen.sh 
*** WARNING: I am going to run 'configure' with no arguments.
*** If you wish to pass any to it, please specify them on the
*** './autogen.sh' command line.

aclocal: installing 'm4/libtool.m4' from '/usr/share/aclocal/libtool.m4'
aclocal: installing 'm4/ltoptions.m4' from '/usr/share/aclocal/ltoptions.m4'
aclocal: installing 'm4/ltsugar.m4' from '/usr/share/aclocal/ltsugar.m4'
...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
config.status: executing depfiles commands
config.status: executing libtool commands
Now type 'make' to compile dicom
$ 

I tried master as well and that worked too.

Perhaps your system is missing parts of autotools? You'll need quite a few dev packages to be able to rebuild the configure system.

pieper commented 2 years ago

Thanks for checking. I installed build-essential and autoconf. I'm not sure what else would be expected.

jcupitt commented 2 years ago

You'll need libtool at least.

Once this thing hits 1.0 there will be a tarball with a pre-built configure, so hopefully this won't be an issue.

pieper commented 2 years ago

This isn't in my critical path, just reporting. I was able to build on a mac and do what I needed. Thanks for the help.

pieper commented 2 years ago

Out of curiosity I installed libtool but there is still something missing.

$ ./autogen.sh 
*** WARNING: I am going to run 'configure' with no arguments.
*** If you wish to pass any to it, please specify them on the
*** './autogen.sh' command line.

aclocal: installing 'm4/libtool.m4' from '/usr/share/aclocal/libtool.m4'
aclocal: installing 'm4/ltoptions.m4' from '/usr/share/aclocal/ltoptions.m4'
aclocal: installing 'm4/ltsugar.m4' from '/usr/share/aclocal/ltsugar.m4'
aclocal: installing 'm4/ltversion.m4' from '/usr/share/aclocal/ltversion.m4'
aclocal: installing 'm4/lt~obsolete.m4' from '/usr/share/aclocal/lt~obsolete.m4'
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force --warnings=no-portability -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force --warnings=no-portability
configure.ac:60: error: possibly undefined macro: AC_DEFINE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
jcupitt commented 2 years ago

Did you install autotools-dev? That's needed too.

pieper commented 2 years ago

Apparently it was already installed and I get the same error after trying to install it.

hackermd commented 2 years ago

@pieper you may want to take a look at the Dockerfile: https://github.com/hackermd/libdicom/blob/736d43f013af55ae80815b2a63419046d12cdeca/Dockerfile#L7-L14

I needed quite a few dependencies to build the library and run the tests. The Dockerfile is for Debian rather than Ubuntu, so there may be some differences in package names, but it hopefully points you in the right direction.

pieper commented 2 years ago

Thanks @hackermd, this set of installs fixed it.

sudo apt-get install autogen dh-autoreconf build-essential check dumb-init libtool pkg-config shtool

After that there's a build error about stncpy that I can make a new issue for.

jcupitt commented 2 years ago

Ah, found it, you need to install pkg-config.

Here's a dockerfile that builds libdicom on ubuntu 20.04:

https://github.com/jcupitt/docker-builds/tree/master/libdicom-ubuntu20.04

hackermd commented 2 years ago

@jcupitt since you provide a link to this repository in your public repository, we may want to open this one up to the public, too. Any concerns?

jcupitt commented 2 years ago

Sure, go ahead. My dockerfile doesn't mean this repo is public, of course.

hackermd commented 2 years ago

Alright! Repo is now public. I also uploaded the documentation to readthedocs.

@pieper the documentation on build dependencies is included in the online documentation: https://libdicom.readthedocs.io/en/latest/installation.html#build-dependencies