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

Error while compiling on MacOSX with -DUSE_LSD2=ON #31

Closed
lguy opened this issue May 27, 2021 · 5 comments
Closed

Error while compiling on MacOSX with -DUSE_LSD2=ON #31

lguy opened this issue May 27, 2021 · 5 comments

Comments

@lguy
Copy link

lguy commented May 27, 2021

Hi there,
First, thanks heaps for providing and maintaining IQTREE, it's one of the most useful and best working molecular evolution tool. It's been working flawless for me, to this day that is, where I'm trying a more experimental feature.
I'm trying to use LSD2 on my Mac. Apparently that feature is not included in the compiled version. I tried to install from source, but got an error.
I have a MacBook Pro with MacOSX 11.4 (20F71). I had to install Boost 1.76.0 and eigen 3.3.9 through brew to get to cmake to work. I cloned iqtree2 (3267aec) with submodules to get lsd2:

git clone --recurse-submodules --remote-submodules https://github.com/iqtree/iqtree2.git
cd iqtree2
mkdir build
cd build
cmake -DIQTREE_FLAGS=omp -DUSE_LSD2=ON ..

That works (see log below). Now trying to make:
% make -j

I'm getting the following errors:

[ 23%] Building CXX object main/CMakeFiles/main.dir/timetree.cpp.o
/Users/liogu139/bin/iqtree2/main/timetree.cpp:275:28: error: no matching constructor
      for initialization of 'lsd::InputOutputStream'
  ...io(tree_stream.str(), outgroup_stream.str(), date_stream.str(), "", "");
     ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/liogu139/bin/iqtree2/lsd2/src/lsd.h:56:9: note: candidate constructor not
      viable: requires 6 arguments, but 5 were provided
        InputOutputStream(string tree, string outgroup, string date,string rate...
        ^
/Users/liogu139/bin/iqtree2/lsd2/src/lsd.h:15:11: note: candidate constructor (the
      implicit copy constructor) not viable: requires 1 argument, but 5 were provided
    class InputOutputStream {
          ^
/Users/liogu139/bin/iqtree2/lsd2/src/lsd.h:48:9: note: candidate constructor not
      viable: requires 0 arguments, but 5 were provided
        InputOutputStream();
        ^
1 error generated.

I've tried to make just lsd2 and that works and I can execute lsd2. My command of C is not good enough to go further, can you help me?

On a side note, I didn't have to install a newer version of Clang separately, the omp version compiled without problem.

Cheers,

Lionel

Log of CMake:

 CMake Deprecation Warning at CMakeLists.txt:58 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/local/lib/cmake/Boost-1.76.0/BoostConfig.cmake (found version "1.76.0")
IQ-TREE flags : omp
Build mode   : Release
Target OS     : Mac OS X
Compiler      : Clang
Compiler version: 11.0.3.11030032
Target binary : 64-bit
OpenMP        : Yes
MPI           : NONE
Vectorization : SSE3/AVX/AVX2
C flags       :  -pthread  -O3 -ffunction-sections -fdata-sections
CXX flags     :  -std=c++11 -stdlib=libc++ -Xpreprocessor -fopenmp -pthread  -O3 -ffunction-sections -fdata-sections
LINKER flags  :  --target=x86_64-apple-macos10.7 -lomp  -Wl,-dead_strip
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for GlobalMemoryStatusEx
-- Looking for GlobalMemoryStatusEx - not found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include
-- Found ZLIB: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libz.tbd (found version "1.2.11")
Using system zlib
-- Performing Test FLAG_WEXTRA
-- Performing Test FLAG_WEXTRA - Success
-- clang-tidy not found.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/liogu139/bin/iqtree2/build
@thomaskf
Copy link
Collaborator

Hi Lionel,
Sorry for the late reply. Can you try the latest version and see whether the problem exists?

The commands are:

git clone --recursive https://github.com/iqtree/iqtree2
cd iqtree2
mkdir build
cd build
cmake -DUSE_LSD2=ON ..
make -j

Thomas

@lguy
Copy link
Author

lguy commented Feb 23, 2022 via email

@lguy lguy closed this as completed Feb 23, 2022
@GianRos
Copy link

GianRos commented Jan 19, 2023

Hello,
maybe it's naive, but I just wanted to notify that this same solution worked well on a Linux Ubuntu 22.04.1 LTS.
Cheers,
Gianluigi

@JGLAHE
Copy link

JGLAHE commented Aug 25, 2023

@thomaskf
Hi Thomas, what is the cmake flag now? cmake -DUSE_LSD2=ON .. doesn't seem to work with 2.2.3?

iqtree2-2.2.3 $>mkdir build; cd build
build $>cmake -DUSE_LSD2=ON ..
CMake Deprecation Warning at CMakeLists.txt:58 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0")
IQ-TREE flags :
Build mode   : Release
Target OS     : Unix
Compiler      : GNU Compiler (gcc)
Compiler version: 11.4.0
Target binary : 64-bit
OpenMP        : Yes
MPI           : NONE
Vectorization : SSE3/AVX/AVX2
C flags       :  -pthread  -O2 -g -ffunction-sections -fdata-sections
CXX flags     :  -std=c++11 -fopenmp -pthread  -O2 -g -ffunction-sections -fdata-sections
LINKER flags  :  -rdynamic  -Wl,--gc-sections
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for GlobalMemoryStatusEx
-- Looking for GlobalMemoryStatusEx - not found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
Using system zlib
CMake Deprecation Warning at yaml-cpp/CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Performing Test FLAG_WEXTRA
-- Performing Test FLAG_WEXTRA - Success
CMake Deprecation Warning at terraphast/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- clang-tidy not found.
CMake Error at CMakeLists.txt:701 (add_subdirectory):
  The source directory

    /PATH/iqtree2-2.2.3/lsd2

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:739 (set_target_properties):
  set_target_properties Can not find target to add properties to: lsd2


-- Configuring incomplete, errors occurred!```

@thomaskf
Copy link
Collaborator

thomaskf commented Aug 25, 2023 via email

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

4 participants