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

cmake configure failure with hyphy 2.5.51 on Debian sid #1627

Closed
emollier opened this issue Jul 9, 2023 · 5 comments
Closed

cmake configure failure with hyphy 2.5.51 on Debian sid #1627

emollier opened this issue Jul 9, 2023 · 5 comments

Comments

@emollier
Copy link

emollier commented Jul 9, 2023

Hi,

When trying to build hyphy 2.5.51 to update the packaging in
Debian, I noticed configuring the build with cmake fails with:

CMake Error at /usr/share/cmake-3.26/Modules/UseSWIG.cmake:939 (add_library):
  Cannot find source file:

    src/lib/link/THyPhy.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
Call Stack (most recent call first):
  CMakeLists.txt:606 (swig_add_library)


CMake Error in CMakeLists.txt:
  Cannot find source file:

    /<<PKGBUILDDIR>>/src/lib/link/THyPhy.i

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc


CMake Error at /usr/share/cmake-3.26/Modules/UseSWIG.cmake:939 (add_library):
  No SOURCES given to target: LIBRARY
Call Stack (most recent call first):
  CMakeLists.txt:606 (swig_add_library)

This seems to be caused by a mismatch between existing files in
the directory src/lib/ and declared files in CMakeFiles.txt
declared in src/lib/link/, directory which doesn't appear to
exist. Also there seems to be a confusion between the real
extension of THyPHy.cxx and the declared one which is
THyPHy.cpp.

I'm considering applying the patch below to allow the build to
go through. I considered opening a merge request, but wasn't
entirely sure you wouldn't have other plans for that part of the
CMakeLists.txt file, which changed already from v2.5.51:

--- hyphy.orig/CMakeLists.txt
+++ hyphy/CMakeLists.txt
@@ -143,7 +143,7 @@
 file(GLOB SRC_NEW src/new/*.cpp)
 file(GLOB SRC_CONTRIB src/contrib/*.cpp)
 
-set(SRC_LINK src/lib/link/THyPhy.cpp)
+set(SRC_LINK src/lib/THyPhy.cxx)
 set(SRC_UNIXMAIN src/mains/unix.cpp)
 set(SRC_UTILS src/utils/hyphyunixutils.cpp)
 
@@ -599,11 +599,11 @@
        find_package (Python3 COMPONENTS Interpreter Development)
        #add_definitions (-D__HEADLESS__)
        INCLUDE_DIRECTORIES(${Python3_INCLUDE_DIRS})
-       SET_SOURCE_FILES_PROPERTIES(src/lib/link/THyPhy.i PROPERTIES CPLUSPLUS ON)
-       #SET_SOURCE_FILES_PROPERTIES(src/lib/link/example.i PROPERTIES CPLUSPLUS ON)
+       SET_SOURCE_FILES_PROPERTIES(src/lib/THyPhy.i PROPERTIES CPLUSPLUS ON)
+       #SET_SOURCE_FILES_PROPERTIES(src/lib/example.i PROPERTIES CPLUSPLUS ON)
 
-       set_property(SOURCE src/lib/link/THyPhy.i  PROPERTY SWIG_MODULE_NAME HyPhy)
-       swig_add_library(LIBRARY LANGUAGE python SOURCES src/lib/link/THyPhy.i src/lib/link/THyPhy.cpp ${SRC_COMMON})
+       set_property(SOURCE src/lib/THyPhy.i  PROPERTY SWIG_MODULE_NAME HyPhy)
+       swig_add_library(LIBRARY LANGUAGE python SOURCES src/lib/THyPhy.i src/lib/THyPhy.cxx ${SRC_COMMON})
        TARGET_LINK_LIBRARIES(LIBRARY ${Python3_LIBRARIES} ${DEFAULT_LIBRARIES})
 
        

Of course, it is quite possible I completely missed something.

Have a nice day, :)
Étienne.

@stephenshank
Copy link
Member

Dear @emollier,

For what it's worth, I've also encountered this issue on the 2.5.51 tag, but do not encounter it on the 2.5.51hf tag.

SWIG appears to have been removed there.

Thank you for sharing your update to CMakeLists.txt, I found it helpful to see how you approached this issue!

Regards,
Stephen

@spond
Copy link
Member

spond commented Jul 10, 2023

Dear @emollier,

Thank you for reporting this issue and providing a fix. We have removed SWIG support from the CMakeFile in the development version and it will be gone from 2.5.52 and later versions, because the library is built using Python's setuptools.

Best,
Sergei

@emollier
Copy link
Author

Hi all,

Thanks for the feedback and highlighting the v2.5.51hf, too bad
our watcher didn't catch the hotfix version. I'll wait for the
v2.5.52 with interest so I can remove my workaround and swig
from the package build dependency tree alltogether.

Have a nice day, :)
Étienne.

@spond
Copy link
Member

spond commented Jul 28, 2023

Dear @emollier,

Should be resolved with 2.5.52.

Best,
Sergei

@emollier
Copy link
Author

Hi,

The issue is indeed resolved in 2.5.52, I close the entry.

Have a nice day, :)
Étienne.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants