@JdittoJ,
Glad to meet you online. I take a particular interest in your post. I've been a consultant for decades to a number of professionals in your exact position, though more often in physics, robotics, AI and other engineering disciplines. My own expertise is primarily software engineering, specifically focused on C++.
The CPLUS_INCLUDE_DIR is an environment variable, a list of variables stored by the operating system as a way to store string information like directory paths, but can store other configuration information. The instruction step from esbtl is merely a means of adding the include path of the library for building future projects.
Though MAC is UNIX, it is particularly configured by Apple to work "their way", though it is fully compliant with UNIX. However, the instruction esbtl provides appears to be for Linux, and I have confirmed from a quick skim of their documentation that they don't support MAC yet, only Linux.
That's not so much a problem as it sounds. However, it will be far less troublesome to install Linux in a virtual machine (please ask here if you're not familiar). That would provide the exact environment ESBTL expects and is supported under. An experienced developer with time and motivation to tinker might get this working on the MAC OS, but I doubt you really want that path.
I've only begun skimming the documentation for ESBTL so I can be better prepared to recognize what issues you'll run into.
Are you familiar with the Boost library, and did you download it? It is a prerequisite for ESBTL, and until you have a Linux install for development on this, I'd suggest you wait for that step.
From my own understanding, I believe I have to create a directory for the ESBTL, so that when I'm actually writing in C++ the ESBTL can then be located when I enter it in the pre-processer command section. I don't know if this is correct, so any info would be appreciated! |
The unpacking/installing instructions for most libraries typically require one to choose a directory, and often developers create a root directory for all such libraries because we usually end up with dozens. Boost will be a requirement, aside the ESBTL directory, so you'll refer to both from your development projects.
Secondly, once the ESBTL has been called in the actual text-editor/compiler, how is each individual PDB file then called in order to input the file to the ESBTL? Do I need to create a directory for the files also? |
Working backwards, it is always a wise organization to use directories as an organizational tool.
From my quick skim, a few lines establish the components required to build a "System", which is ESTBL's design for storing and accessing hierarchical data, organizing the information from models made of chains, where chains are made of residues and residues are made of atoms.
Then, you provide the filename of the PDB.
This informs me that you'll also be asking, soon, about how to select files in a directory, how to loop through a collection of files in a directory...all typical C++ development tasks.
That, too, suggests to me you may be intent on building a GUI application, but if you're keeping this simple, you might build command line tools - as of yet I can't tell.
As we continue here in this thread it may become of interest to establish a more direct, corroborative exchange, so you can send PM's to me if that becomes appropriate and of interest to you.
EDIT & Update:
I decided to try a build on MAC to see if it works. It does, so the Linux box requirement is not actually required. There are a few, simple steps to get that to work, but easily accomplished (relatively).
One must install boost on the MAC first (I used 1.7.0 - and built the entire binary set - not certain if all of it is required, but I use boost elsewhere anyway).
The simple example provided with ESBTL compiled as expected and worked with the sample PDB provided, so it is a "go".
No doubt you can, and probably should, ignore the "CPLUS_INCLUDE_DIR" instruction, and merely indicate the include paths as part of the build configuration (it is more flexible that way).
You also need CMake (an easy install for MAC).
Here are the basics of the steps (and a few key details to help).
Download boost (UNIX), and unzip it. Move the resulting directory to a preferred location (I chose /Users/niccolo/Development - where upon boost resides in boost_1_70_0 in the Development directory).
Then, as the instructions suggest, open a terminal, navigate to the boost directory (the one I just detailed), and issue the boostrap command (more in a moment). This command is in the "getting started" instructions for boost, which can be a bit daunting because they don't get to the point right away.
assuming the terminal is changed to the boost directory, this is the command to enter, substituting your preferred path instead of mine
./bootstrap.sh --prefix=/Users/niccolo/Development/boost_1_70_0
This builds the build engine for boost (I know, seems redundant).
Next, you'll build boost. This takes a while...depends on your computer's performance. The command I recommend is this, but read the note(s) following before issuing the command
sudo ./b2 -a cxxflags=-std=c++17 variant=debug,release link=shared,static threading=single,multi address-model=64 install stage --layout=tagged runtime-link=shared,static -j3
This mess of a command line chooses the important options for building boost. This configuration choice worked without issue to build the ESBTL sample on MAC.
It does assume you have a recent XCode installed with the command line tools (automatic upon first launch of XCode). It builds debug and release versions, for static and shared libraries as well as static and shared runtimes, all in 64 bit modes (all recent versions of MAC OS require 64 bit builds), with the tagged layout.
The "-j3" at the end tells the build system to compile at most 3 targets at once in parallel. I don't recommend maximizing your machine, which is to say if you have 4 cores with 8 threads, don't use -j4 or -j8. If you know your machine really well it is ok to do that, but I don't know your machine well and if there's sufficient lint in your heatsink then maximizing the load could overheat your computer. If you know your machine is very, very well cooled, choose as you like, but for smooth operation at the expense of some extra time, let your machine work at around half or so of its core count. On a 4 core, -j2 (maybe -j3) is ok. In winter I do -j8 on a 4 core with 8 threads, but after 15 or 20 minutes the heat would possibly exceed margins of safety in summer, especially with my cats nearby.
More in another post....
The tagged layout is particularly important here. This means that any library, say chrono, will be built for each of the options (static/shared, debug/release, threaded/not-threaded), and will be named as such. You won't need to know the names, but as an example:
1 2
|
libboost_chrono_d-x64.a
libboost_chrono_mt_d_x64.a
|
These two (of 6 different permutations) are the debug and multi-threaded debug versions of the chrono library. Fortunately the way boost operates means the appropriate library is automatically selected based on the build configuration of your application.