Derecho-Project / derecho

The main code repository for the Derecho project.
BSD 3-Clause "New" or "Revised" License
187 stars 47 forks source link

Assorted Build Issues #134

Closed gduzan closed 5 years ago

gduzan commented 5 years ago

These are from a Fedora 30 build and an alternate install directory for non-Fedora packages.

In CMakeLists.txt, explicitly include directories: ${mutils_INCLUDE_DIRS} ${mutils-tasks_INCLUDE_DIRS} ${mutils-containers_INCLUDE_DIRS}

In src/persistent/CMakeLists.txt, reference ${mutils_LIBRARIES} instead of mutils in target_link_libraries.

In src/utils/logger.cpp, include spdlog/spdlog.h before other spdlog includes.

I haven't run any tests yet, but with the above the build and install complete successfully. (Apologies for the lack of diffs or a pull request, but Corporate policy would require me to get high level approval first.)

songweijia commented 5 years ago

I tried with both Fedora 29 and 30. Things went normally. So, which commit are you using? And could you should me the error messages?

gduzan commented 5 years ago
localhost.localdomain { ~/work/git } % mkdir derecho/build                                                                                                                                                                                     
localhost.localdomain { ~/work/git } % !165                                                                                                                                                                                                    
( cd derecho/build ; cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/derecho -DCMAKE_PREFIX_PATH=/opt/derecho .. )                                                                                                                
-- The CXX compiler identification is GNU 9.1.1                                                                                                                                                                                                
-- Check for working CXX compiler: /usr/bin/c++                                                                                                                                                                                                
-- Check for working CXX compiler: /usr/bin/c++ -- works                                                                                                                                                                                       
-- Detecting CXX compiler ABI info                                                                                                                                                                                                             
-- Detecting CXX compiler ABI info - done                                                                                                                                                                                                      
-- Detecting CXX compile features                                                                                                                                                                                                              
-- Detecting CXX compile features - done                                                                                                                                                                                                       
-- Found libfabric: /usr/lib64/libfabric.so                                                                                                                                                                                                    
-- The C compiler identification is GNU 9.1.1                                                                                                                                                                                                  
-- Check for working C compiler: /usr/bin/cc                                                                                                                                                                                                   
-- Check for working C compiler: /usr/bin/cc -- works                                                                                                                                                                                          
-- Detecting C compiler ABI info                                                                                                                                                                                                               
-- Detecting C compiler ABI info - done                                                                                                                                                                                                        
-- Detecting C compile features                                                                                                                                                                                                                
-- Detecting C compile features - done                                                                                                                                                                                                         
-- Configuring done                                                                                                                                                                                                                            
-- Generating done                                                                                                                                                                                                                             
-- Build files have been written to: /home/e1045187/work/git/derecho/build                                                                                                                                                                     
localhost.localdomain { ~/work/git } % !166                                                                                                                                                                                                    
( cd derecho/build/ ; make )                                                                                                                                                                                                                   
Scanning dependencies of target persistent                                                                                                                                                                                                     
[  0%] Building CXX object src/persistent/CMakeFiles/persistent.dir/Persistent.cpp.o                                                                                                                                                           
In file included from /home/e1045187/work/git/derecho/include/derecho/persistent/PersistNoLog.hpp:9,                                                                                                                                           
                 from /home/e1045187/work/git/derecho/include/derecho/persistent/Persistent.hpp:9,                                                                                                                                             
                 from /home/e1045187/work/git/derecho/src/persistent/Persistent.cpp:1:                                                                                                                                                         
/home/e1045187/work/git/derecho/include/derecho/mutils-serialization/SerializationSupport.hpp:2:10: fatal error: mutils/macro_utils.hpp: No such file or directory                                                                             
    2 | #include <mutils/macro_utils.hpp>                                                                                                                                                                                                      
      |          ^~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                      
compilation terminated.                                                                                                                                                                                                                        
make[2]: *** [src/persistent/CMakeFiles/persistent.dir/build.make:63: src/persistent/CMakeFiles/persistent.dir/Persistent.cpp.o] Error 1                                                                                                       
make[1]: *** [CMakeFiles/Makefile2:865: src/persistent/CMakeFiles/persistent.dir/all] Error 2                                                                                                                                                  
make: *** [Makefile:130: all] Error 2                                                                                                                                                                                                          
localhost.localdomain { ~/work/git } % git -C derecho log -n 1 --oneline
fcb36cc (HEAD -> master, origin/master, origin/HEAD) Discussed with Ken, set default value of DERECHO/disable_partitioning_safety to true

Note that mutils and friends were also built with the /opt/derecho CMAKE_INSTALL_PREFIX to keep non-packaged files separate from packaged ones. I have to set LD_LIBRARY_PATH to get the result working properly, so it isn't a complete fix, but it is a start. The spdlog include seems like it should be reproducible, but I haven't looked into it in detail.

songweijia commented 5 years ago

The reason is that your dependencies (mutils, mutils-containers, mutils-tasks) are not installed in a place visible to cmake. You can add the location of mutils folder containing mutilsConfig.cmake to environment variable CMAKE_PREFIX_PATH. By default, mutils is installed to /usr/local/lib/cmake/. In your case, it should be /opt/derecho/usr/local/lib/cmake.

songweijia commented 5 years ago

until @gduzan responded.

songweijia commented 5 years ago

@gduzan, have you tried my suggestion? Do you mind if I close this issue if you don't have more comments?

gduzan commented 5 years ago

Sorry, I haven't been able to put any more time into experimenting with Derecho, so I'll close it for now.