Linux fixes clang (#1313)

* Changes to work on Linux.
* Bring back AA Trail Lines on Linux.
* Included new branch with correction in cfitsio library linking.
* Updated SGCT
* Changes to compile in Clang on Linux.

Authored-by: Jonathas <jon.costa@gmail.com>
Authored-by: Tom Schober <tom@tomschober.com>
This commit is contained in:
Alexander Bock
2020-10-09 18:43:10 +02:00
committed by GitHub
parent 50a456b87f
commit e33498f8a6
11 changed files with 49 additions and 36 deletions
+13 -11
View File
@@ -40,6 +40,8 @@
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/quaternion.hpp>
#include <glm/gtx/transform.hpp>
#include <cfloat>
#include <cmath>
#include <fstream>
#include <iostream>
#include <sstream>
@@ -211,7 +213,7 @@ int addExoplanetSystem(lua_State* L) {
);
}
bool notEnoughData = isnan(p.positionX) || isnan(p.a) || isnan(p.per);
bool notEnoughData = std::isnan(p.positionX) || std::isnan(p.a) || std::isnan(p.per);
if (notEnoughData) {
return ghoul::lua::luaError(
@@ -264,7 +266,7 @@ int addExoplanetSystem(lua_State* L) {
// Star renderable globe, if we have a radius
std::string starGlobeRenderableString;
const float starRadius = p.rStar;
if (!isnan(starRadius)) {
if (!std::isnan(starRadius)) {
std::ifstream colorMap(absPath(BvColormapPath), std::ios::in);
if (!colorMap.good()) {
@@ -329,21 +331,21 @@ int addExoplanetSystem(lua_State* L) {
Exoplanet planet = planetSystem[i];
const std::string planetName = planetNames[i];
if (isnan(planet.ecc)) {
if (std::isnan(planet.ecc)) {
planet.ecc = 0.f;
}
if (isnan(planet.i)) {
if (std::isnan(planet.i)) {
planet.i = 90.f;
}
if (isnan(planet.bigOm)) {
if (std::isnan(planet.bigOm)) {
planet.bigOm = 180.f;
}
if (isnan(planet.om)) {
if (std::isnan(planet.om)) {
planet.om = 90.f;
}
Time epoch;
std::string sEpoch;
if (!isnan(planet.tt)) {
if (!std::isnan(planet.tt)) {
epoch.setTime("JD " + std::to_string(planet.tt));
sEpoch = std::string(epoch.ISO8601());
}
@@ -358,8 +360,8 @@ int addExoplanetSystem(lua_State* L) {
const float solarRadius = static_cast<float>(distanceconstants::SolarRadius);
const float jupiterRadius = static_cast<float>(distanceconstants::JupiterRadius);
if (isnan(planet.r)) {
if (isnan(planet.rStar)) {
if (std::isnan(planet.r)) {
if (std::isnan(planet.rStar)) {
planetRadius = planet.a * 0.001f * astronomicalUnit;
}
else {
@@ -446,8 +448,8 @@ int addExoplanetSystem(lua_State* L) {
openspace::scripting::ScriptEngine::RemoteScripting::Yes
);
bool hasUpperAUncertainty = !isnan(planet.aUpper);
bool hasLowerAUncertainty = !isnan(planet.aLower);
bool hasUpperAUncertainty = !std::isnan(planet.aUpper);
bool hasLowerAUncertainty = !std::isnan(planet.aLower);
if (hasUpperAUncertainty && hasLowerAUncertainty) {
// Get the orbit plane of the planet trail orbit from the KeplerTranslation
@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_MODULE_EXOPLENETS___RENDERABLEORBITDISC___H__
#ifndef __OPENSPACE_MODULE_EXOPLANETS___RENDERABLEORBITDISC___H__
#define __OPENSPACE_MODULE_EXOPLANETS___RENDERABLEORBITDISC___H__
#include <openspace/properties/stringproperty.h>
@@ -36,7 +36,6 @@
namespace ghoul::filesystem { class File; }
namespace ghoul::opengl {
class ProgramObject;
class Texture;
} // namespace ghoul::opengl
namespace openspace {
@@ -80,4 +79,4 @@ private:
} // namespace openspace
#endif // __OPENSPACE_MODULE_EXOPLENETS___RENDERABLEORBITDISC___H__
#endif // __OPENSPACE_MODULE_EXOPLANETS___RENDERABLEORBITDISC___H__
+2
View File
@@ -53,9 +53,11 @@ set(MODULE_NAME openspace-module-fitsfilereader)
# CCfits is dependent on cfitsio, let it handle the internal linking
add_subdirectory(${CFITSIO_ROOT_DIR})
set_folder_location(cfitsio "External")
set(cfitsio_BUILD_SHARED_LIBS OFF)
add_subdirectory(${CCFITS_ROOT_DIR})
set_folder_location(CCfits "External")
set(CCfits_BUILD_SHARED_LIBS OFF)
if (GHOUL_DISABLE_EXTERNAL_WARNINGS)
disable_external_warnings(cfitsio)
+14 -12
View File
@@ -51,14 +51,16 @@
#include <ghoul/systemcapabilities/openglcapabilitiescomponent.h>
#include <numeric>
#include <queue>
#ifndef __APPLE__
#include <memory_resource>
#else
#include <vector>
#if defined(__APPLE__) || (defined(__linux__) && defined(__clang__))
#include <experimental/memory_resource>
namespace std {
using namespace experimental;
} // namespace std
#endif // __APPLE__
#else
#include <memory_resource>
#endif
namespace {
// Global flags to modify the RenderableGlobe
@@ -268,22 +270,22 @@ const Chunk& findChunkNode(const Chunk& node, const Geodetic2& location) {
return *n;
}
#ifndef __APPLE__
using ChunkTileVector = std::pmr::vector<std::pair<ChunkTile, const LayerRenderSettings*>>;
#else // __APPLE__
#if defined(__APPLE__) || (defined(__linux__) && defined(__clang__))
using ChunkTileVector = std::vector<std::pair<ChunkTile, const LayerRenderSettings*>>;
#endif // __APPLE__
#else
using ChunkTileVector = std::pmr::vector<std::pair<ChunkTile, const LayerRenderSettings*>>;
#endif
ChunkTileVector tilesAndSettingsUnsorted(const LayerGroup& layerGroup,
const TileIndex& tileIndex)
{
ZoneScoped
#ifndef __APPLE__
ChunkTileVector tilesAndSettings(&global::memoryManager.TemporaryMemory);
#else // __APPLE__
#if defined(__APPLE__) || (defined(__linux__) && defined(__clang__))
ChunkTileVector tilesAndSettings;
#endif // __APPLE__
#else
ChunkTileVector tilesAndSettings(&global::memoryManager.TemporaryMemory);
#endif
for (Layer* layer : layerGroup.activeLayers()) {
if (layer->tileProvider()) {
tilesAndSettings.emplace_back(