IBM / rl-testbed-for-energyplus

Reinforcement Learning Testbed for Power Consumption Optimization using EnergyPlus
MIT License
186 stars 77 forks source link

install build error #51

Closed connorvr closed 3 years ago

connorvr commented 3 years ago

I am having trouble completing the install. I am using version 9.2.0 of energy plus and installing it on ubuntu 18.04.5.

I have attempted a number of clean installs, I most often get the following error after trying to run the cmake line: CMake Error: The source directory "/EnergyPlus/build" does not appear to contain CMakeLists.txt.

I did however get it to run the cmake script successfully once (which I haven't been able to reproduce) only to get the following error running the 'make -j4' line: make: *** No targets specified and no makefile found. Stop.

Any help would be greatly appreciated.

antoine-galataud commented 3 years ago

Hi @connorvr To ease investigation, It'd be helpful to post the sequence of commands you executed and their output. Thx.

connorvr commented 3 years ago

Of course:

`~/Documents/energy rl$ sudo bash EnergyPlus-9.2.0-921312fa1d-Linux-x86_64.sh [sudo] password for connorvr: EnergyPlus, Copyright (c) 1996-2019, The Board of Trustees of the University of Illinois, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.

NOTICE: This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit others to do so.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

(3) Neither the name of the University of California, Lawrence Berkeley National Laboratory, the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

(4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form without changes from the version obtained under this License, or (ii) Licensee makes a reference solely to the software portion of its product, Licensee must refer to the software as "EnergyPlus version X" software, where "X" is the version number Licensee obtained under this License and may not use a different name for the software. Except as specifically required in this Section (4), Licensee shall not use in a company name, a product name, in advertising, publicity, or other promotional activities any name, trade name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly similar designation, without the U.S. Department of Energy's prior written consent.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Do you accept the license? [y/\033[1;31mN\033[0m]: y EnergyPlus install directory [/usr/local/EnergyPlus-9-2-0]:

Symbolic link location (enter \033[1;31m"n"\033[0m for no links) [/usr/local/bin]:

Extracting, please wait... Unpacking to directory '/usr/local/EnergyPlus-9-2-0' was successful. Symbolic links were successful.

~/Documents/energy rl$ git clone -b v9.2.0 git@github.com:NREL/EnergyPlus.git Cloning into 'EnergyPlus'... The authenticity of host 'github.com (52.64.108.95)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,52.64.108.95' (RSA) to the list of known hosts. remote: Enumerating objects: 9, done. remote: Counting objects: 100% (9/9), done. remote: Compressing objects: 100% (9/9), done. remote: Total 263067 (delta 1), reused 1 (delta 0), pack-reused 263058 Receiving objects: 100% (263067/263067), 609.90 MiB | 612.00 KiB/s, done. Resolving deltas: 100% (209201/209201), done. Note: checking out '921312fa1d0c9e6fe1c1f2d10ee3bf066895b85e'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

Checking out files: 100% (11755/11755), done.

~/Documents/energy rl$ git clone git@github.com:ibm/rl-testbed-for-energyplus.git Cloning into 'rl-testbed-for-energyplus'... Warning: Permanently added the RSA host key for IP address '13.236.229.21' to the list of known hosts. remote: Enumerating objects: 44, done. remote: Counting objects: 100% (44/44), done. remote: Compressing objects: 100% (30/30), done. remote: Total 229 (delta 22), reused 28 (delta 14), pack-reused 185 Receiving objects: 100% (229/229), 2.36 MiB | 587.00 KiB/s, done. Resolving deltas: 100% (101/101), done.

~/Documents/energy rl$ cd EnergyPlus

~/Documents/energy rl/EnergyPlus$ patch -p1 < ../rl-testbed-for-energyplus/EnergyPlus/RL-patch-for-EnergyPlus-9-2-0.patch patching file src/EnergyPlus/CMakeLists.txt patching file src/EnergyPlus/DataRuntimeLanguage.cc patching file src/EnergyPlus/DataRuntimeLanguage.hh patching file src/EnergyPlus/EvaporativeCoolers.cc patching file src/EnergyPlus/ExtCtrl.cc patching file src/EnergyPlus/ExtCtrl.hh patching file src/EnergyPlus/RuntimeLanguageProcessor.cc patch unexpectedly ends in middle of line Hunk #5 succeeded at 4361 with fuzz 2.

~/Documents/energy rl/EnergyPlus$ mkdir build

~/Documents/energy rl/EnergyPlus$ cd build

~/Documents/energy rl/EnergyPlus/build$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/EnergyPlus-9-2-0 CMake Error: The source directory "/home/connorvr/Documents/energy rl/EnergyPlus/build" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI.`

antoine-galataud commented 3 years ago

Just a guess: have you tried to clone in a directory structure with no spaces in names? There is energy rl I’m suspicious about

connorvr commented 3 years ago

No, I have used that in other attempts. I did another clean install though just to be sure and all output are exactly the same, with the same final error: ~/Documents/energy_rl/EnergyPlus/build$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/EnergyPlus-9-2-0 CMake Error: The source directory "/home/connorvr/Documents/energy_rl/EnergyPlus/build" does not appear to contain CMakeLists.txt.

antoine-galataud commented 3 years ago

Aren’t you missing the .. at the end of cmake -DCMAKE_INSTALL_PREFIX=/usr/local/EnergyPlus-9-2-0 ? Please double check with readme

connorvr commented 3 years ago

Ah, yes. That is very embarrassing.. Thank you for finding that. I am now getting the error I was previously getting: `~/Documents/energy_rl/EnergyPlus/build$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/EnergyPlus-9-2-0 .. -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is unknown -- 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 CMake Error at CMakeLists.txt:8 (Project): No CMAKE_CXX_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred! See also "/home/connorvr/Documents/energy_rl/EnergyPlus/build/CMakeFiles/CMakeOutput.log". See also "/home/connorvr/Documents/energy_rl/EnergyPlus/build/CMakeFiles/CMakeError.log".

~/Documents/energy_rl/EnergyPlus/build$ make -j4 make: *** No targets specified and no makefile found. Stop. `

Here is the CMakeError.log contents. `Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: CMAKE_CXX_COMPILER-NOTFOUND Build flags: Id flags:

The output was: No such file or directory

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: CMAKE_CXX_COMPILER-NOTFOUND Build flags: Id flags: -c

The output was: No such file or directory

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: CMAKE_CXX_COMPILER-NOTFOUND Build flags: Id flags: --c++

The output was: No such file or directory

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: CMAKE_CXX_COMPILER-NOTFOUND Build flags: Id flags: --ec++

The output was: No such file or directory

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: CMAKE_CXX_COMPILER-NOTFOUND Build flags: Id flags:

The output was: No such file or directory

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: CMAKE_CXX_COMPILER-NOTFOUND Build flags: Id flags: -c

The output was: No such file or directory

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: CMAKE_CXX_COMPILER-NOTFOUND Build flags: Id flags: --c++

The output was: No such file or directory

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: CMAKE_CXX_COMPILER-NOTFOUND Build flags: Id flags: --ec++

The output was: No such file or directory

`

antoine-galataud commented 3 years ago

Seems like you’re missing a C++ compiler: No CMAKE_CXX_COMPILER could be found

You should be able to fix this with apt install g++

connorvr commented 3 years ago

that worked a treat, the cmake line completed ~/Documents/energy_rl/EnergyPlus/build$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/EnergyPlus-9-2-0 .. -- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.17", minimum required is "2.7") -- Looking for dlfcn.h -- Looking for dlfcn.h - found -- Looking for fcntl.h -- Looking for fcntl.h - found -- Looking for inttypes.h -- Looking for inttypes.h - found -- Looking for memory.h -- Looking for memory.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stdlib.h -- Looking for stdlib.h - found -- Looking for strings.h -- Looking for strings.h - found -- Looking for string.h -- Looking for string.h - found -- Looking for sys/stat.h -- Looking for sys/stat.h - found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for unistd.h -- Looking for unistd.h - found -- Looking for getpagesize -- Looking for getpagesize - found -- Looking for bcopy -- Looking for bcopy - found -- Looking for memmove -- Looking for memmove - found -- Looking for mmap -- Looking for mmap - found -- Looking for off_t -- Looking for off_t - not found -- Looking for size_t -- Looking for size_t - not found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of off64_t -- Check size of off64_t - done -- Looking for fseeko -- Looking for fseeko - found -- Looking for unistd.h -- Looking for unistd.h - found -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success -- Performing Test COMPILER_HAS_DEPRECATED_ATTR -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success -- Configuring done -- Generating done -- Build files have been written to: /home/connorvr/Documents/energy_rl/EnergyPlus/build

However the make -j4 produces an error now: [ 63%] Building CXX object src/EnergyPlus/CMakeFiles/energypluslib.dir/EvaporativeFluidCoolers.cc.o [ 64%] Building CXX object src/EnergyPlus/CMakeFiles/energypluslib.dir/ExtCtrl.cc.o In file included from /usr/include/c++/7/cassert:44:0, from /home/connorvr/Documents/energy_rl/EnergyPlus/third_party/ObjexxFCL/src/ObjexxFCL/floops.hh:23, from /home/connorvr/Documents/energy_rl/EnergyPlus/src/EnergyPlus/EnergyPlus.hh:146, from /home/connorvr/Documents/energy_rl/EnergyPlus/src/EnergyPlus/ExtCtrl.hh:61, from /home/connorvr/Documents/energy_rl/EnergyPlus/src/EnergyPlus/ExtCtrl.cc:61: /home/connorvr/Documents/energy_rl/EnergyPlus/src/EnergyPlus/ExtCtrl.cc: In function ‘std::__cxx11::string EnergyPlus::ExtCtrl::ExtCtrlRead()’: /home/connorvr/Documents/energy_rl/EnergyPlus/src/EnergyPlus/ExtCtrl.cc:178:23: error: no match for ‘operator==’ (operand types are ‘int’ and ‘std::cxx11::string {aka std::cxx11::basic_string}’) assert(act_seq == seq);



I imagine it has to do with the C++ compiler. This is the version I have installing g++ 
ii  g++                                        4:7.4.0-1ubuntu2.3                               amd64        GNU C++ compiler
ii  g++-7                                      7.5.0-3ubuntu1~18.04                             amd64        GNU C++ compiler
connorvr commented 3 years ago

Another attempt at a clean install seemed to have fixed what ever issue that was. Thanks for your help.