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

autogen.sh: check directly for libtoolize instead of libtool [as libtool is not used here] #3886

Merged
merged 2 commits into from
Jan 13, 2024

Conversation

balay
Copy link
Contributor

@balay balay commented Dec 4, 2023

On ubuntu - libtoolize can be installed without libtool. So best to check directly for libtoolize - instead of indirectly via libtool

$ ./autogen.sh

**************************
* HDF5 autogen.sh script * **************************

Running trace script:
Finished processing HDF5 API calls:
	instrumented 0 API functions and 0 argument lists

Running error generation script:
Generating 'H5Epubgen.h'
Generating 'H5Einit.h'
Generating 'H5Eterm.h'
Generating 'H5Edefin.h'

Running API version generation script:
Generating 'H5version.h'

Running overflow macro generation script:
Generating 'H5overflow.h'

./libtoolize --copy --force
./autogen.sh: 202: ./libtoolize: not found

…ool is not used here]

On Ubuntu - libtoolize can be installed without libtool. So best to check directly for libtoolize - instead of indirectly via libtool

$ ./autogen.sh

**************************
* HDF5 autogen.sh script *
**************************

Running trace script:
Finished processing HDF5 API calls:
	instrumented 0 API functions and 0 argument lists

Running error generation script:
Generating 'H5Epubgen.h'
Generating 'H5Einit.h'
Generating 'H5Eterm.h'
Generating 'H5Edefin.h'

Running API version generation script:
Generating 'H5version.h'

Running overflow macro generation script:
Generating 'H5overflow.h'

./libtoolize --copy --force
./autogen.sh: 202: ./libtoolize: not found
@glennsong09 glennsong09 added Priority - 3. Low 🔽 Code cleanup, small feature change requests, etc. Component - Build CMake, Autotools Type - Improvement Improvements that don't add a new feature or functionality labels Dec 5, 2023
*)
HDF5_LIBTOOLIZE="${LIBTOOL_DIR}/libtoolize"
;;
esac
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing the MacOS hack?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand.

MacOS hack is already at line 116 above.

My change is removing the redirection from "libtool" to "libtoolize/glibtoolize" - i.e why not look directly for libtoolize/glibtoolize [as libtool is not really used in this script - only libtoolize/glibtoolize is used]?

My build on MacOS goes through fine with this PR change

balay@mpro git.hdf5 % sw_vers              
ProductName:		macOS
ProductVersion:		14.1.2
BuildVersion:		23B92
balay@mpro git.hdf5 % which libtool        
/usr/bin/libtool
balay@mpro git.hdf5 % which libtoolize     
libtoolize not found
balay@mpro git.hdf5 % which glibtool       
/opt/homebrew/bin/glibtool
balay@mpro git.hdf5 % which glibtoolize    
/opt/homebrew/bin/glibtoolize
balay@mpro git.hdf5 % git show -q --oneline
d86cb0da314 (HEAD) autogen.sh: check directly for libtoolize instead of libtool [as libtool is not used here]
balay@mpro git.hdf5 % ./autogen.sh 

**************************
* HDF5 autogen.sh script *
**************************

Running trace script:
Finished processing HDF5 API calls:
	instrumented 0 API functions and 0 argument lists

Running error generation script:
Generating 'H5Epubgen.h'
Generating 'H5Einit.h'
Generating 'H5Eterm.h'
Generating 'H5Edefin.h'

Running API version generation script:
Generating 'H5version.h'

Running overflow macro generation script:
Generating 'H5overflow.h'

/opt/homebrew/bin/glibtoolize --copy --force
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'bin'.
glibtoolize: copying file 'bin/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
glibtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

NOTE: You can ignore the warning about adding -I m4.
      We already do this in an included file.

/opt/homebrew/bin/aclocal --force -I m4 -I /opt/homebrew/bin/../share/aclocal

/opt/homebrew/bin/autoheader --force

/opt/homebrew/bin/automake --copy --add-missing --force-missing
configure.ac:506: installing 'bin/compile'
configure.ac:136: installing 'bin/config.guess'
configure.ac:136: installing 'bin/config.sub'
configure.ac:35: installing 'bin/install-sh'
configure.ac:35: installing 'bin/missing'
parallel-tests: installing 'bin/test-driver'
c++/src/Makefile.am: installing 'bin/depcomp'

/opt/homebrew/bin/autoconf --force --warnings=no-obsolete

*** SUCCESS ***

balay@mpro git.hdf5 % 


Or perhaps I don't know the use case - where the build breaks without this extra re-direction [from libtool to libtoolize]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking if there are any issues to resolve before this PR can be merged!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - I didn't see that since I was looking at the PR on my phone.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous MacOS code would check for both glibtoolize and libtoolize, but this change makes it only check for glibtoolize. If it's working, great, let's simplify, but it might need the previous hack if other devs need libtoolize instead of glibtoolize on the Mac.

Copy link
Contributor

@qkoziol qkoziol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need to check for both libtoolize and glibtoolize on the Mac. I suggest this code on all platforms, instead of the case:

    HDF5_LIBTOOLIZE="$(command -v glibtoolize)"
    if [ ! -f "$HDF5_LIBTOOLIZE" ] ; then
        HDF5_LIBTOOLIZE="$(command -v libtoolize)"
    fi

@balay
Copy link
Contributor Author

balay commented Jan 12, 2024

Might need to check for both libtoolize and glibtoolize on the Mac. I suggest this code on all platforms, instead of the case:

thanks, pushed!

@derobins derobins merged commit b72cc4f into HDFGroup:develop Jan 13, 2024
lrknox pushed a commit to lrknox/hdf5 that referenced this pull request Feb 15, 2024
…ool is not used here] (HDFGroup#3886)

* autogen.sh: check directly for libtoolize instead of libtool [as libtool is not used here]

* autogen.sh: simplify (g)libtoolize check - look for glibtoolize first - and then libtoolize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Build CMake, Autotools Priority - 3. Low 🔽 Code cleanup, small feature change requests, etc. Type - Improvement Improvements that don't add a new feature or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants