NREL / SolarPILOT

SolarPILOT power tower layout and optimization tool
https://www.nrel.gov/csp/solarpilot.html
Other
47 stars 17 forks source link

Installation requires file stapi.h - file not found #31

Open sacorbet97 opened 5 years ago

sacorbet97 commented 5 years ago

When installing in Ubuntu 18, went through all previous steps, went through to calling make in /spt_dev/SolarPILOT/build_linux, received the following error:

In file included from ../../ssc/solarpilot/SolarField.h:57:0,
                 from ../../ssc/solarpilot/Flux.cpp:56:
../../ssc/solarpilot/interop.h:63:10: fatal error: stapi.h: No such file or directory
 #include "stapi.h"
          ^~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'Flux.o' failed
make[1]: *** [Flux.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from ../../ssc/solarpilot/SolarField.h:57:0,
                 from ../../ssc/solarpilot/Financial.cpp:55:
../../ssc/solarpilot/interop.h:63:10: fatal error: stapi.h: No such file or directory
 #include "stapi.h"
          ^~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'Financial.o' failed
make[1]: *** [Financial.o] Error 1
In file included from ../../ssc/solarpilot/SolarField.h:57:0,
                 from ../../ssc/solarpilot/LayoutSimulateThread.h:54,
                 from ../../ssc/solarpilot/AutoPilot_API.cpp:58:
../../ssc/solarpilot/interop.h:63:10: fatal error: stapi.h: No such file or directory
 #include "stapi.h"
          ^~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'AutoPilot_API.o' failed
make[1]: *** [AutoPilot_API.o] Error 1
virtual memory exhausted: Cannot allocate memory
<builtin>: recipe for target 'definitions.o' failed
make[1]: *** [definitions.o] Error 1
make[1]: Leaving directory '/home/sarah/spt_dev/SolarPILOT/build_linux'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2

In the instructions it says that building SolTrace is optional, so I didn't build it. Would like to know where stapi.h is so that I can install.

mjwagner2 commented 5 years ago

@sacorbet97 I'll close this and if it turns out this is a bug in the makefile, then we can reopen this issue and address it.

The stapi.h file is located in the SolTrace project in the /coretrace folder. You are right that you don't need to build the SolTrace interface in order to build SolarPILOT. However, you do need to build the coretrace library which is part of SolTrace.

There are a couple of things that might cause stapi.h to not be found.

  1. Make sure that the HOMEDIR variable is set appropriately in the Makefile-UI.
  2. Make sure that SolTrace is located in the same parent folder as SolarPILOT.
  3. The Makefile looks for files in ../../soltrace/coretrace/ relative to the solarpilot/build_linux directory. If you have mismatched capitalization in your path to coretrace, it won't find the file.
sacorbet97 commented 5 years ago

Hello @mjwagner2 I went through all those steps and it still comes up with the same errors. This is my Makefile-UI, or at least the beginning of it

VPATH = ../app

#<<<<<<< update for local machine
HOMEDIR = /home/sarah/spt_dev

SSCDIR = $(HOMEDIR)/ssc
WEXDIR = $(HOMEDIR)/wex
WEXLIB = $(WEXDIR)/wexuxwx3.a
LKDIR = $(HOMEDIR)/lk
LKLIB = $(LKDIR)/lkuxwx3.a
STDIR = $(HOMEDIR)/SolTrace/coretrace
STLIB = $(STDIR)/build_linux/coretrace.a
SHAREDIR = $(SSCDIR)/build_linux
SHAREDLIB = $(SHAREDIR)/shared.a
FCLIB = ./fieldcore.a
FCDIR = $(SSCDIR)/solarpilot
NLOPTLIB = $(SHAREDIR)/nlopt.a

CC = g++ 
CXX = g++
CFLAGS = -I. -I$(WEXDIR)/include -I$(LKDIR)/include -I$(SSCDIR) -I../rapidxml -I$(FCDIR) -I$(STDIR) -D__64BIT__ -g -O3 -std=c++0x -DLK_USE_WXWIDGETS -DSP_STANDALONE -D_GLIBCXX_USE_NANOSLEEP `wx-config-3 --cflags` 

CXXFLAGS = $(CFLAGS)
LDFLAGS =  $(WEXLIB) $(LKLIB) $(STLIB) $(FCLIB) $(NLOPTLIB) $(SHAREDLIB)  `wx-config-3 --libs stc` `wx-config-3 --libs aui` `wx-config-3 --libs` -lm  -lfontconfig -ldl -lcurl
mjwagner2 commented 5 years ago

@sacorbet97

I just noticed that the Makefile-UI and Makefile-solarpilot have different capitalization for the path to STDIR. In the Makefile-UI, I see it is defined as $(HOMEDIR)/SolTrace/coretrace, and in Makefile-solarpilot it is $(HOMEDIR)/soltrace/coretrace. This is causing the problem. I'm working on several fixes for the linux build that came up from the last pull request. I will be creating a new pull request with this and the other fixes later today, and at that point, it should work.

sacorbet97 commented 5 years ago

Thank you, I will reinstall it now and see if it works.

sacorbet97 commented 5 years ago

Ok, bypassed the stapi.h file issue, but now getting this error:

sarah@sarah-VirtualBox:~/spt_dev/SolarPILOT/build_linux$ make
make -f Makefile-solarpilot -j4
make[1]: Entering directory '/home/sarah/spt_dev/SolarPILOT/build_linux'
make[1]: 'fieldcore.a' is up to date.
make[1]: Leaving directory '/home/sarah/spt_dev/SolarPILOT/build_linux'
make -f Makefile-UI -j4
make[1]: Entering directory '/home/sarah/spt_dev/SolarPILOT/build_linux'
g++ -I. -Ihome/sarah/spt_dev/wex/include -Ihome/sarah/spt_dev/lk/include -Ihome/sarah/spt_dev/ssc -I../rapidxml -Ihome/sarah/spt_dev/ssc/solarpilot -Ihome/sarah/spt_dev/SolTrace/coretrace -D__64BIT__ -g -O3 -std=c++0x -DLK_USE_WXWIDGETS -DSP_STANDALONE -D_GLIBCXX_USE_NANOSLEEP `wx-config-3 --cflags`    -c -o FieldPlot.o ../app/FieldPlot.cpp
g++ -I. -Ihome/sarah/spt_dev/wex/include -Ihome/sarah/spt_dev/lk/include -Ihome/sarah/spt_dev/ssc -I../rapidxml -Ihome/sarah/spt_dev/ssc/solarpilot -Ihome/sarah/spt_dev/SolTrace/coretrace -D__64BIT__ -g -O3 -std=c++0x -DLK_USE_WXWIDGETS -DSP_STANDALONE -D_GLIBCXX_USE_NANOSLEEP `wx-config-3 --cflags`    -c -o FluxPlot.o ../app/FluxPlot.cpp
g++ -I. -Ihome/sarah/spt_dev/wex/include -Ihome/sarah/spt_dev/lk/include -Ihome/sarah/spt_dev/ssc -I../rapidxml -Ihome/sarah/spt_dev/ssc/solarpilot -Ihome/sarah/spt_dev/SolTrace/coretrace -D__64BIT__ -g -O3 -std=c++0x -DLK_USE_WXWIDGETS -DSP_STANDALONE -D_GLIBCXX_USE_NANOSLEEP `wx-config-3 --cflags`    -c -o GUI_ClimatePage.o ../app/GUI_ClimatePage.cpp
g++ -I. -Ihome/sarah/spt_dev/wex/include -Ihome/sarah/spt_dev/lk/include -Ihome/sarah/spt_dev/ssc -I../rapidxml -Ihome/sarah/spt_dev/ssc/solarpilot -Ihome/sarah/spt_dev/SolTrace/coretrace -D__64BIT__ -g -O3 -std=c++0x -DLK_USE_WXWIDGETS -DSP_STANDALONE -D_GLIBCXX_USE_NANOSLEEP `wx-config-3 --cflags`    -c -o GUI_CostPage.o ../app/GUI_CostPage.cpp
../app/GUI_ClimatePage.cpp:55:10: fatal error: shared/lib_weatherfile.h: No such file or directory
 #include <shared/lib_weatherfile.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'GUI_ClimatePage.o' failed
make[1]: *** [GUI_ClimatePage.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from ../app/FieldPlot.cpp:60:0:
../app/FieldPlot.h:60:10: fatal error: treemesh.h: No such file or directory
 #include "treemesh.h"
          ^~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'FieldPlot.o' failed
make[1]: *** [FieldPlot.o] Error 1
In file included from ../app/FluxPlot.cpp:55:0:
../app/FluxPlot.h:58:10: fatal error: SolarField.h: No such file or directory
 #include "SolarField.h"
          ^~~~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'FluxPlot.o' failed
make[1]: *** [FluxPlot.o] Error 1
In file included from ../app/GUI_CostPage.cpp:53:0:
../app/GUI_main.h:77:10: fatal error: string_util.h: No such file or directory
 #include "string_util.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'GUI_CostPage.o' failed
make[1]: *** [GUI_CostPage.o] Error 1
make[1]: Leaving directory '/home/sarah/spt_dev/SolarPILOT/build_linux'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2

I've looked through the makefiles to see if there is something wrong with them, and I have checked my other files to see if I can find them myself and they are there.