Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c0794376da | ||
|
08863984e6 | ||
|
a1f2891446 | ||
|
6af57a167d | ||
|
5750c1c673 | ||
|
8e2e9d08e6 | ||
|
571e49d6fb | ||
|
0cce18e062 | ||
|
2c0c4f36d0 | ||
|
5b2e9d3595 | ||
|
f527245d6c | ||
|
5847dc2503 | ||
|
36549e0d82 | ||
|
d67371ac4f | ||
|
8695861c9d | ||
|
25f54246e5 | ||
|
4be62182e6 | ||
|
3a8c66037b | ||
|
b8f28f9769 | ||
|
746d91b5a0 | ||
|
cd452aaec5 | ||
|
97a55a6e51 | ||
|
f7b846d293 | ||
|
0fb03e979b | ||
|
906d4e7096 | ||
|
d624d7fdc6 | ||
|
f530941d29 | ||
|
636fc415e6 | ||
|
31fbff1716 | ||
|
76d02396b5 | ||
|
e83a571102 | ||
|
508818c4a4 | ||
|
056a2e973e | ||
|
2cc67dcde1 | ||
|
b62e4a5adb | ||
|
477e6782c4 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -13,3 +13,7 @@ gdl-0.9rc4.tar.gz
|
|||||||
/gdl-0.9.8-git-d892ee5.tar.gz
|
/gdl-0.9.8-git-d892ee5.tar.gz
|
||||||
/gdl-0.9.9.tar.gz
|
/gdl-0.9.9.tar.gz
|
||||||
/gdl-0.9.9-git-2870075.tar.gz
|
/gdl-0.9.9-git-2870075.tar.gz
|
||||||
|
/gdl-1.0.0-git-4892c96.tar.gz
|
||||||
|
/gdl-1.0.0.tar.gz
|
||||||
|
/gdl-1.0.1.tar.gz
|
||||||
|
/gdl-1.0.2.tar.gz
|
||||||
|
174
1486.patch
Normal file
174
1486.patch
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
From 6a3337ff29917a4766f80ffb19e24a55251f1511 Mon Sep 17 00:00:00 2001
|
||||||
|
From: GillesDuvert <gilles.duvert@free.fr>
|
||||||
|
Date: Fri, 20 Jan 2023 17:47:56 +0100
|
||||||
|
Subject: [PATCH 1/2] try to permit distro builders to put drivers in
|
||||||
|
GDL_LIB_DIR but still make normal (non-distro) build as usual and moreover
|
||||||
|
enable relocation of gdl executable ans all its componenets, including
|
||||||
|
drivers, as it is now done for installers on Windows and OSX.
|
||||||
|
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 1 +
|
||||||
|
config.h.cmake | 1 +
|
||||||
|
src/gdl.cpp | 24 +++++++++++++++++++-----
|
||||||
|
src/objects.cpp | 2 ++
|
||||||
|
src/objects.hpp | 2 ++
|
||||||
|
5 files changed, 25 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index b0cecea36..281e12979 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -144,6 +144,7 @@ set(JPEGDIR "" CACHE PATH "GDL: Specify the JPEG directory tree")
|
||||||
|
set(SZIPDIR "" CACHE PATH "GDL: Specify the SZip directory tree")
|
||||||
|
|
||||||
|
set(GDL_DATA_DIR "/share/gnudatalanguage" CACHE PATH "GDL: data directory relative to CMAKE_INSTALL_PREFIX")
|
||||||
|
+set(GDL_LIB_DIR "" CACHE PATH "GDL: library directory relative to CMAKE_INSTALL_PREFIX")
|
||||||
|
|
||||||
|
# check for 64-bit OS
|
||||||
|
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||||
|
diff --git a/config.h.cmake b/config.h.cmake
|
||||||
|
index 07c7fa199..4637af869 100644
|
||||||
|
--- a/config.h.cmake
|
||||||
|
+++ b/config.h.cmake
|
||||||
|
@@ -3,6 +3,7 @@
|
||||||
|
|
||||||
|
#define EXEC_PREFIX "@CMAKE_INSTALL_PREFIX@"
|
||||||
|
#define GDLDATADIR "@CMAKE_INSTALL_PREFIX@@GDL_DATA_DIR@"
|
||||||
|
+#define GDLLIBDIR "@GDL_LIB_DIR@"
|
||||||
|
#define VERSION "@VERSION@"
|
||||||
|
|
||||||
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
diff --git a/src/gdl.cpp b/src/gdl.cpp
|
||||||
|
index bf9947ae3..445145331 100644
|
||||||
|
--- a/src/gdl.cpp
|
||||||
|
+++ b/src/gdl.cpp
|
||||||
|
@@ -250,8 +250,10 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
|
//The default installation location --- will not always be there.
|
||||||
|
gdlDataDir = std::string(GDLDATADIR);
|
||||||
|
+ gdlLibDir = std::string(GDLLIBDIR);
|
||||||
|
#ifdef _WIN32
|
||||||
|
std::replace(gdlDataDir.begin(), gdlDataDir.end(), '/', '\\');
|
||||||
|
+ std::replace(gdlLibDir.begin(), gdlLibDir.end(), '/', '\\');
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//check where is the executable being run
|
||||||
|
@@ -269,16 +271,28 @@ int main(int argc, char *argv[])
|
||||||
|
if( gdlPath == "") gdlPath=GetEnvString("IDL_PATH"); //warning: is a Path, use system separator.
|
||||||
|
if( gdlPath == "") gdlPath = gdlDataDir + lib::PathSeparator() + "lib";
|
||||||
|
|
||||||
|
-//drivers if local
|
||||||
|
+//LIBDIR. Can be '' in which case the location of drivers is deduced from the location of
|
||||||
|
+//the executable (OSX, Windows, unix in user-installed mode).
|
||||||
|
+ string driversPath = GetEnvPathString("GDL_DRV_DIR");
|
||||||
|
+ if (driversPath == "") { //NOT enforced by GDL_DRV_DIR
|
||||||
|
+ driversPath = gdlLibDir; //e.g. Fedora
|
||||||
|
+ if (driversPath == "") { //NOT enforced by GDLLIBDIR at build : not a distro
|
||||||
|
+ driversPath = gdlDataDir + lib::PathSeparator() + "drivers"; //deduced from the location of the executable
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ //drivers if local
|
||||||
|
useLocalDrivers=false;
|
||||||
|
bool driversNotFound=false;
|
||||||
|
- string driversPath=gdlDataDir + lib::PathSeparator() + "drivers";
|
||||||
|
- //We'll ned to get the current value for PLPLOT_DRV_DIR if any (useful later if something goes wrong below)
|
||||||
|
- static const char* DrvEnvName="PLPLOT_DRV_DIR";
|
||||||
|
+
|
||||||
|
+ //The current value for PLPLOT_DRV_DIR.
|
||||||
|
+ //To find our drivers, the plplot library needs to have PLPLOT_DRV_DIR set to the good path, i.e., driversPath.
|
||||||
|
+ const char* DrvEnvName = "PLPLOT_DRV_DIR";
|
||||||
|
+ //In a startup message (below), the value of $PLPLOT_DRV_DIR appears.
|
||||||
|
+ //It will be the value set inside the program (just below) to find the relevant drivers.
|
||||||
|
|
||||||
|
#ifdef INSTALL_LOCAL_DRIVERS
|
||||||
|
useLocalDrivers=true;
|
||||||
|
- //For WIN32 the drivers dlls are copied alongwith the gdl.exe and plplot does not use PLPLOT_DRV_DIR to find them.
|
||||||
|
+ //For WIN32 the drivers dlls are copied along with the gdl.exe and plplot does not use PLPLOT_DRV_DIR to find them.
|
||||||
|
#ifndef _WIN32
|
||||||
|
char* oldDriverEnv=getenv(DrvEnvName);
|
||||||
|
// We must declare here (and not later) where our local copy of (customized?) drivers is to be found.
|
||||||
|
diff --git a/src/objects.cpp b/src/objects.cpp
|
||||||
|
index d31991998..cc8d23088 100644
|
||||||
|
--- a/src/objects.cpp
|
||||||
|
+++ b/src/objects.cpp
|
||||||
|
@@ -98,6 +98,8 @@ antlr::ASTFactory DNodeFactory("DNode",DNode::factory);
|
||||||
|
|
||||||
|
//this string contains the value of DATADIR
|
||||||
|
std::string gdlDataDir;
|
||||||
|
+//this string contains the value of LIBDIR
|
||||||
|
+std::string gdlLibDir;
|
||||||
|
//do we use WxWidgets at all?
|
||||||
|
volatile bool useWxWidgets;
|
||||||
|
//do we use WxWidgets for graphics?
|
||||||
|
diff --git a/src/objects.hpp b/src/objects.hpp
|
||||||
|
index e65059a11..7cde23877 100644
|
||||||
|
--- a/src/objects.hpp
|
||||||
|
+++ b/src/objects.hpp
|
||||||
|
@@ -71,6 +71,8 @@ extern volatile bool sigControlC;
|
||||||
|
|
||||||
|
//this string contains the value of DATADIR
|
||||||
|
extern std::string gdlDataDir;
|
||||||
|
+//this string contains the value of LIBDIR
|
||||||
|
+extern std::string gdlLibDir;
|
||||||
|
|
||||||
|
extern volatile bool iAmANotebook;
|
||||||
|
// tells if wxwidgets is to be used at all...
|
||||||
|
|
||||||
|
From 7688f0b931d03d7ff15e552dac3666ebd819cd82 Mon Sep 17 00:00:00 2001
|
||||||
|
From: GillesDuvert <gilles.duvert@free.fr>
|
||||||
|
Date: Sat, 21 Jan 2023 19:56:56 +0100
|
||||||
|
Subject: [PATCH 2/2] enable GDL_LIB_DIR positioning of .so files (drivers),
|
||||||
|
something needed by distributions (Debian, Fedora...)
|
||||||
|
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 8 +++++++-
|
||||||
|
config.h.cmake | 1 +
|
||||||
|
src/plplotdriver/CMakeLists.txt | 4 ++--
|
||||||
|
3 files changed, 10 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 281e12979..5c674e141 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -145,7 +145,13 @@ set(SZIPDIR "" CACHE PATH "GDL: Specify the SZip directory tree")
|
||||||
|
|
||||||
|
set(GDL_DATA_DIR "/share/gnudatalanguage" CACHE PATH "GDL: data directory relative to CMAKE_INSTALL_PREFIX")
|
||||||
|
set(GDL_LIB_DIR "" CACHE PATH "GDL: library directory relative to CMAKE_INSTALL_PREFIX")
|
||||||
|
-
|
||||||
|
+#define (for plplotdriver/CMakeLists.txt) the GDL_DRV_DIR where the drivers will be installed.
|
||||||
|
+#if GDL_LIB_DIR is empty, it will be the default (GDL_DATA_DIR/drivers) otherwise it is GDL_LIB_DIR (not GDL_LIB_DIR/drivers)
|
||||||
|
+if ( GDL_LIB_DIR STREQUAL "" OR NOT GDL_LIB_DIR)
|
||||||
|
+ set (GDL_DRV_DIR "${CMAKE_INSTALL_PREFIX}/${GDL_DATA_DIR}/drivers") # CACHE PATH "GDL: where the drivers will be installed.")
|
||||||
|
+else()
|
||||||
|
+ set (GDL_DRV_DIR "${GDL_LIB_DIR}" ) # CACHE PATH "GDL: where the drivers will be installed.")
|
||||||
|
+endif()
|
||||||
|
# check for 64-bit OS
|
||||||
|
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||||
|
set(HAVE_64BIT_OS 1)
|
||||||
|
diff --git a/config.h.cmake b/config.h.cmake
|
||||||
|
index 4637af869..7080df9a6 100644
|
||||||
|
--- a/config.h.cmake
|
||||||
|
+++ b/config.h.cmake
|
||||||
|
@@ -4,6 +4,7 @@
|
||||||
|
#define EXEC_PREFIX "@CMAKE_INSTALL_PREFIX@"
|
||||||
|
#define GDLDATADIR "@CMAKE_INSTALL_PREFIX@@GDL_DATA_DIR@"
|
||||||
|
#define GDLLIBDIR "@GDL_LIB_DIR@"
|
||||||
|
+#define GDL_DRV_DIR "@GDL_DRV_DIR@"
|
||||||
|
#define VERSION "@VERSION@"
|
||||||
|
|
||||||
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
diff --git a/src/plplotdriver/CMakeLists.txt b/src/plplotdriver/CMakeLists.txt
|
||||||
|
index 69e5062b1..a48742c10 100644
|
||||||
|
--- a/src/plplotdriver/CMakeLists.txt
|
||||||
|
+++ b/src/plplotdriver/CMakeLists.txt
|
||||||
|
@@ -66,8 +66,8 @@ if(INSTALL_LOCAL_DRIVERS)
|
||||||
|
|
||||||
|
foreach(v IN LISTS WHAT)
|
||||||
|
set_target_properties(${v} PROPERTIES PREFIX "" SUFFIX ${DYNAMIC_SUFFIX} )
|
||||||
|
- install(TARGETS ${v} DESTINATION ${CMAKE_INSTALL_PREFIX}/${GDL_DATA_DIR}/drivers)
|
||||||
|
- install( FILES ${v}.driver_info DESTINATION ${CMAKE_INSTALL_PREFIX}/${GDL_DATA_DIR}/drivers)
|
||||||
|
+ install(TARGETS ${v} DESTINATION ${GDL_DRV_DIR})
|
||||||
|
+ install( FILES ${v}.driver_info DESTINATION ${GDL_DRV_DIR})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
endif(INSTALL_LOCAL_DRIVERS)
|
@ -1,20 +1,20 @@
|
|||||||
diff -up gdl-287007567ba3998b4b70119025c3def86bdef649/src/CMakeLists.txt.antlr gdl-287007567ba3998b4b70119025c3def86bdef649/src/CMakeLists.txt
|
diff -up gdl-1.0.2/src/CMakeLists.txt.antlr gdl-1.0.2/src/CMakeLists.txt
|
||||||
--- gdl-287007567ba3998b4b70119025c3def86bdef649/src/CMakeLists.txt.antlr 2019-09-16 03:51:53.000000000 -0600
|
--- gdl-1.0.2/src/CMakeLists.txt.antlr 2023-01-06 10:39:47.000000000 -0700
|
||||||
+++ gdl-287007567ba3998b4b70119025c3def86bdef649/src/CMakeLists.txt 2019-09-16 21:13:52.240535555 -0600
|
+++ gdl-1.0.2/src/CMakeLists.txt 2023-01-16 08:51:18.033486027 -0700
|
||||||
@@ -291,9 +291,7 @@ sax.cpp
|
@@ -197,9 +197,7 @@ endif(HAVE_LIBWXWIDGETS AND WIN32)
|
||||||
)
|
#local plplot drivers
|
||||||
endif(USE_EXPAT)
|
add_subdirectory(plplotdriver)
|
||||||
|
|
||||||
-add_subdirectory(antlr)
|
-add_subdirectory(antlr)
|
||||||
-
|
-
|
||||||
-include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/antlr ${CMAKE_BINARY_DIR})
|
-include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/antlr ${CMAKE_SOURCE_DIR}/src/plplotdriver ${CMAKE_BINARY_DIR})
|
||||||
+include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR})
|
+include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/plplotdriver ${CMAKE_BINARY_DIR})
|
||||||
link_directories(${LINK_DIRECTORIES})
|
link_directories(${LINK_DIRECTORIES})
|
||||||
|
|
||||||
if(PYTHON_MODULE) #GDL.so
|
if(PYTHON_MODULE) #GDL.so
|
||||||
@@ -308,7 +306,6 @@ else(PYTHON_MODULE) #GDL.so
|
@@ -217,7 +215,6 @@ if(USE_OPENMP)
|
||||||
add_executable(gdl ${SOURCES})
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||||
endif(PYTHON_MODULE)
|
endif(USE_OPENMP)
|
||||||
|
|
||||||
-add_dependencies(gdl antlr) # be sure that antlr is built before gdl
|
-add_dependencies(gdl antlr) # be sure that antlr is built before gdl
|
||||||
target_link_libraries(gdl antlr) # link antlr against gdl
|
target_link_libraries(gdl antlr) # link antlr against gdl
|
||||||
|
@ -1,182 +0,0 @@
|
|||||||
diff --git a/src/datatypes.cpp b/src/datatypes.cpp
|
|
||||||
index 1a8d126..e8b08a1 100644
|
|
||||||
--- a/src/datatypes.cpp
|
|
||||||
+++ b/src/datatypes.cpp
|
|
||||||
@@ -18,6 +18,7 @@
|
|
||||||
#include "includefirst.hpp"
|
|
||||||
|
|
||||||
#if defined(USE_PYTHON) || defined(PYTHON_MODULE)
|
|
||||||
+#include <patchlevel.h>
|
|
||||||
#include <numpy/arrayobject.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
diff --git a/src/gdlpython.cpp b/src/gdlpython.cpp
|
|
||||||
index 7835ec9..dd17598 100644
|
|
||||||
--- a/src/gdlpython.cpp
|
|
||||||
+++ b/src/gdlpython.cpp
|
|
||||||
@@ -32,18 +32,32 @@
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+int PythonInit()
|
|
||||||
+{
|
|
||||||
+ if( Py_IsInitialized()) return NULL;
|
|
||||||
+#else
|
|
||||||
void PythonInit()
|
|
||||||
{
|
|
||||||
if( Py_IsInitialized()) return;
|
|
||||||
+#endif
|
|
||||||
Py_Initialize(); // signal handlers?
|
|
||||||
|
|
||||||
static int argc = 1;
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+ static wchar_t* arg0 = Py_DecodeLocale("./py/python.exe",NULL);
|
|
||||||
+ static wchar_t* argv[] = {arg0};
|
|
||||||
+#else
|
|
||||||
static char* arg0 = (char*)"./py/python.exe";
|
|
||||||
static char* argv[] = {arg0};
|
|
||||||
+#endif
|
|
||||||
PySys_SetArgv(argc, argv);
|
|
||||||
|
|
||||||
// http://docs.scipy.org/doc/numpy/reference/c-api.array.html#miscellaneous
|
|
||||||
import_array();
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+ return NULL;
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void PythonEnd()
|
|
||||||
@@ -71,6 +85,12 @@ BaseGDL* FromPython( PyObject* pyObj)
|
|
||||||
{
|
|
||||||
if( !PyArray_Check( pyObj))
|
|
||||||
{
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+ if( PyUnicode_Check( pyObj))
|
|
||||||
+ {
|
|
||||||
+ return new DStringGDL( PyUnicode_AsUTF8( pyObj));
|
|
||||||
+ }
|
|
||||||
+#else
|
|
||||||
if( PyString_Check( pyObj))
|
|
||||||
{
|
|
||||||
return new DStringGDL( PyString_AsString( pyObj));
|
|
||||||
@@ -79,6 +99,7 @@ BaseGDL* FromPython( PyObject* pyObj)
|
|
||||||
{
|
|
||||||
return new DLongGDL( PyInt_AsLong( pyObj));
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
if( PyLong_Check( pyObj))
|
|
||||||
{
|
|
||||||
return new DLongGDL( PyLong_AsLong( pyObj));
|
|
||||||
@@ -174,11 +195,19 @@ namespace lib {
|
|
||||||
e->Throw( "ARGV keyword must be of type STRING.");
|
|
||||||
|
|
||||||
int argc = argvS->N_Elements();
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+ wchar_t** argv = new wchar_t*[ argc];
|
|
||||||
+#else
|
|
||||||
char** argv = new char*[ argc];
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
- // pyhton copies the value -> threats it as const
|
|
||||||
+ // python copies the value -> treats it as const
|
|
||||||
for( int i=0; i<argc; ++i)
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+ argv[i] = Py_DecodeLocale(const_cast<char*>((*argvS)[ i].c_str()), NULL);
|
|
||||||
+#else
|
|
||||||
argv[i] = const_cast<char*>((*argvS)[ i].c_str());
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
PySys_SetArgv(argc, argv);
|
|
||||||
delete[] argv;
|
|
||||||
diff --git a/src/gdlpython.hpp b/src/gdlpython.hpp
|
|
||||||
index 45ef436..cb53bd7 100644
|
|
||||||
--- a/src/gdlpython.hpp
|
|
||||||
+++ b/src/gdlpython.hpp
|
|
||||||
@@ -18,7 +18,11 @@
|
|
||||||
#ifndef GDLPYTHON_HPP_
|
|
||||||
#define GDLPYTHON_HPP_
|
|
||||||
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+int PythonInit();
|
|
||||||
+#else
|
|
||||||
void PythonInit();
|
|
||||||
+#endif
|
|
||||||
void PythonEnd();
|
|
||||||
BaseGDL* FromPython( PyObject* pyObj);
|
|
||||||
|
|
||||||
diff --git a/src/pythongdl.cpp b/src/pythongdl.cpp
|
|
||||||
index a3b5afd..e541ba5 100644
|
|
||||||
--- a/src/pythongdl.cpp
|
|
||||||
+++ b/src/pythongdl.cpp
|
|
||||||
@@ -191,14 +191,22 @@ bool CopyArgFromPython( vector<BaseGDL*>& parRef,
|
|
||||||
for( SizeT k=0; k<nKW; ++k)
|
|
||||||
{
|
|
||||||
PyDict_Next( kwDict, &dictPos, &key, &value);
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+ int keyIsString = PyUnicode_Check( key);
|
|
||||||
+#else
|
|
||||||
int keyIsString = PyString_Check( key);
|
|
||||||
+#endif
|
|
||||||
if( !keyIsString)
|
|
||||||
{
|
|
||||||
PyErr_SetString( gdlError,
|
|
||||||
"Keywords must be of type string");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+ const char* keyChar = PyUnicode_AsUTF8( key);
|
|
||||||
+#else
|
|
||||||
const char* keyChar = PyString_AsString( key);
|
|
||||||
+#endif
|
|
||||||
string keyString = StrUpCase( keyChar);
|
|
||||||
int kwIx = e.GetPro()->FindKey( keyString);
|
|
||||||
if( kwIx == -1)
|
|
||||||
@@ -523,6 +531,35 @@ extern "C" {
|
|
||||||
{NULL, NULL, 0, NULL} // Sentinel
|
|
||||||
};
|
|
||||||
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+ struct module_state {
|
|
||||||
+ PyObject *error;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ #define GETSTATE(m) ((struct module_state*)PyModule_GetState(m))
|
|
||||||
+
|
|
||||||
+ static int GDL_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
||||||
+ Py_VISIT(GETSTATE(m)->error);
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ static int GDL_clear(PyObject *m) {
|
|
||||||
+ Py_CLEAR(GETSTATE(m)->error);
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ static struct PyModuleDef moduledef = {
|
|
||||||
+ PyModuleDef_HEAD_INIT,
|
|
||||||
+ "GDL",
|
|
||||||
+ NULL,
|
|
||||||
+ sizeof(struct module_state),
|
|
||||||
+ GDLMethods,
|
|
||||||
+ NULL,
|
|
||||||
+ GDL_traverse,
|
|
||||||
+ GDL_clear,
|
|
||||||
+ NULL
|
|
||||||
+ };
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
// python GDL module init function
|
|
||||||
PyMODINIT_FUNC initGDL()
|
|
||||||
@@ -552,7 +589,11 @@ extern "C" {
|
|
||||||
}
|
|
||||||
SysVar::SetGDLPath( gdlPath);
|
|
||||||
|
|
||||||
+#if PY_MAJOR_VERSION >= 3
|
|
||||||
+ PyObject* m = PyModule_Create(&moduledef);
|
|
||||||
+#else
|
|
||||||
PyObject* m = Py_InitModule("GDL", GDLMethods);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
gdlError = PyErr_NewException((char*)"GDL.error", NULL, NULL);
|
|
||||||
Py_INCREF(gdlError);
|
|
58
gdl-size.patch
Normal file
58
gdl-size.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
diff -up gdl-1.0.2/src/qhull.cpp.size gdl-1.0.2/src/qhull.cpp
|
||||||
|
--- gdl-1.0.2/src/qhull.cpp.size 2023-01-06 10:39:47.000000000 -0700
|
||||||
|
+++ gdl-1.0.2/src/qhull.cpp 2023-01-16 19:35:16.464432434 -0700
|
||||||
|
@@ -784,7 +784,7 @@ int output_qhull_voronoi_local(Qhull* qh
|
||||||
|
func = e->GetParAs<DDoubleGDL>(3); //input function
|
||||||
|
tetra_list = e->GetParAs<DLongGDL>(4); //indices of tetrahedra vertices from qhull
|
||||||
|
|
||||||
|
- int inDim = e->GetParAs<DDoubleGDL>(0)->Dim(0);
|
||||||
|
+ SizeT inDim = e->GetParAs<DDoubleGDL>(0)->Dim(0);
|
||||||
|
p0 = new DDoubleGDL( *(new dimension(3, inDim)), BaseGDL::ZERO ); //concatenation of the 3 separate inputs arrays
|
||||||
|
|
||||||
|
for(int i=0; i<3; i++)
|
||||||
|
@@ -794,7 +794,7 @@ int output_qhull_voronoi_local(Qhull* qh
|
||||||
|
{
|
||||||
|
e->Throw("separated input arrays must have same length and be 1 dimensional");
|
||||||
|
}
|
||||||
|
- for(int j=0; j<inDim; j++) (*p0)[i+j*3] = (*par)[j];
|
||||||
|
+ for(SizeT j=0; j<inDim; j++) (*p0)[i+j*3] = (*par)[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -819,9 +819,9 @@ int output_qhull_voronoi_local(Qhull* qh
|
||||||
|
|
||||||
|
// putting input points in a vector...
|
||||||
|
vector<Vec3> points;
|
||||||
|
- points.reserve(np);
|
||||||
|
+ points.resize(np);
|
||||||
|
|
||||||
|
- for (int i =0; i < np; i++)
|
||||||
|
+ for (size_t i =0; i < np; i++)
|
||||||
|
{
|
||||||
|
points[i] = { (*p0)[3*i], (*p0)[3*i+1], (*p0)[3*i+2] };
|
||||||
|
//TODO handle not finite values
|
||||||
|
@@ -829,7 +829,7 @@ int output_qhull_voronoi_local(Qhull* qh
|
||||||
|
|
||||||
|
// vector holding all necessary info on the triangulation
|
||||||
|
vector<Tetra> tetra_data;
|
||||||
|
- tetra_data.reserve(n_tetra);
|
||||||
|
+ tetra_data.resize(n_tetra);
|
||||||
|
|
||||||
|
// directly available info
|
||||||
|
array<int,4> empty_neighbours {-1,-1,-1,-1};
|
||||||
|
@@ -848,7 +848,7 @@ int output_qhull_voronoi_local(Qhull* qh
|
||||||
|
// TOO SLOW, FIND ANOTHER METHOD
|
||||||
|
|
||||||
|
vector<int> tetra_neigh_count(n_tetra, 0);
|
||||||
|
- tetra_neigh_count.reserve(n_tetra);
|
||||||
|
+ tetra_neigh_count.resize(n_tetra);
|
||||||
|
|
||||||
|
for(int i=0; i<n_tetra; ++i)
|
||||||
|
{
|
||||||
|
@@ -1062,4 +1062,4 @@ int output_qhull_voronoi_local(Qhull* qh
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
-}
|
||||||
|
\ No newline at end of file
|
||||||
|
+}
|
@ -1,53 +0,0 @@
|
|||||||
diff -up gdl-287007567ba3998b4b70119025c3def86bdef649/src/dSFMT/dSFMT-common.h.std gdl-287007567ba3998b4b70119025c3def86bdef649/src/dSFMT/dSFMT-common.h
|
|
||||||
--- gdl-287007567ba3998b4b70119025c3def86bdef649/src/dSFMT/dSFMT-common.h.std 2019-09-16 03:51:53.000000000 -0600
|
|
||||||
+++ gdl-287007567ba3998b4b70119025c3def86bdef649/src/dSFMT/dSFMT-common.h 2019-09-16 21:15:07.887885236 -0600
|
|
||||||
@@ -44,25 +44,25 @@ static const union X128I_T sse2_param_ma
|
|
||||||
#if defined(HAVE_ALTIVEC)
|
|
||||||
inline static void do_recursion(w128_t *r, w128_t *a, w128_t * b,
|
|
||||||
w128_t *lung) {
|
|
||||||
- const vector unsigned char sl1 = ALTI_SL1;
|
|
||||||
- const vector unsigned char sl1_perm = ALTI_SL1_PERM;
|
|
||||||
- const vector unsigned int sl1_msk = ALTI_SL1_MSK;
|
|
||||||
- const vector unsigned char sr1 = ALTI_SR;
|
|
||||||
- const vector unsigned char sr1_perm = ALTI_SR_PERM;
|
|
||||||
- const vector unsigned int sr1_msk = ALTI_SR_MSK;
|
|
||||||
- const vector unsigned char perm = ALTI_PERM;
|
|
||||||
- const vector unsigned int msk1 = ALTI_MSK;
|
|
||||||
- vector unsigned int w, x, y, z;
|
|
||||||
+ const __vector unsigned char sl1 = ALTI_SL1;
|
|
||||||
+ const __vector unsigned char sl1_perm = ALTI_SL1_PERM;
|
|
||||||
+ const __vector unsigned int sl1_msk = ALTI_SL1_MSK;
|
|
||||||
+ const __vector unsigned char sr1 = ALTI_SR;
|
|
||||||
+ const __vector unsigned char sr1_perm = ALTI_SR_PERM;
|
|
||||||
+ const __vector unsigned int sr1_msk = ALTI_SR_MSK;
|
|
||||||
+ const __vector unsigned char perm = ALTI_PERM;
|
|
||||||
+ const __vector unsigned int msk1 = ALTI_MSK;
|
|
||||||
+ __vector unsigned int w, x, y, z;
|
|
||||||
|
|
||||||
z = a->s;
|
|
||||||
w = lung->s;
|
|
||||||
- x = vec_perm(w, (vector unsigned int)perm, perm);
|
|
||||||
- y = vec_perm(z, (vector unsigned int)sl1_perm, sl1_perm);
|
|
||||||
+ x = vec_perm(w, (__vector unsigned int)perm, perm);
|
|
||||||
+ y = vec_perm(z, (__vector unsigned int)sl1_perm, sl1_perm);
|
|
||||||
y = vec_sll(y, sl1);
|
|
||||||
y = vec_and(y, sl1_msk);
|
|
||||||
w = vec_xor(x, b->s);
|
|
||||||
w = vec_xor(w, y);
|
|
||||||
- x = vec_perm(w, (vector unsigned int)sr1_perm, sr1_perm);
|
|
||||||
+ x = vec_perm(w, (__vector unsigned int)sr1_perm, sr1_perm);
|
|
||||||
x = vec_srl(x, sr1);
|
|
||||||
x = vec_and(x, sr1_msk);
|
|
||||||
y = vec_and(w, msk1);
|
|
||||||
diff -up gdl-287007567ba3998b4b70119025c3def86bdef649/src/dSFMT/dSFMT.h.std gdl-287007567ba3998b4b70119025c3def86bdef649/src/dSFMT/dSFMT.h
|
|
||||||
--- gdl-287007567ba3998b4b70119025c3def86bdef649/src/dSFMT/dSFMT.h.std 2019-09-16 03:51:53.000000000 -0600
|
|
||||||
+++ gdl-287007567ba3998b4b70119025c3def86bdef649/src/dSFMT/dSFMT.h 2019-09-16 21:15:07.887885236 -0600
|
|
||||||
@@ -143,7 +143,7 @@ extern "C" {
|
|
||||||
|
|
||||||
/** 128-bit data structure */
|
|
||||||
union W128_T {
|
|
||||||
- vector unsigned int s;
|
|
||||||
+ __vector unsigned int s;
|
|
||||||
uint64_t u[2];
|
|
||||||
uint32_t u32[4];
|
|
||||||
double d[2];
|
|
313
gdl.spec
313
gdl.spec
@ -1,83 +1,86 @@
|
|||||||
%global commit 287007567ba3998b4b70119025c3def86bdef649
|
%global commit 4892c96996d23a77c153737ace2d1f171938f560
|
||||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||||
|
%global __cmake_in_source_build 1
|
||||||
|
|
||||||
|
%bcond_without java
|
||||||
|
|
||||||
|
# No more Java on i686
|
||||||
|
ExcludeArch: %{ix86}
|
||||||
|
|
||||||
|
|
||||||
Name: gdl
|
Name: gdl
|
||||||
Version: 0.9.9
|
Version: 1.0.2
|
||||||
Release: 13.20190915git%{shortcommit}%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: GNU Data Language
|
Summary: GNU Data Language
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPL-2.0-or-later
|
||||||
URL: http://gnudatalanguage.sourceforge.net/
|
URL: http://gnudatalanguage.sourceforge.net/
|
||||||
#Source0: https://github.com/gnudatalanguage/gdl/archive/v%{version}/gdl-%{version}.tar.gz
|
Source0: https://github.com/gnudatalanguage/gdl/archive/v%{version}/gdl-%{version}.tar.gz
|
||||||
Source0: https://github.com/gnudatalanguage/gdl/archive/%{commit}/gdl-%{version}-git-%{shortcommit}.tar.gz
|
#Source0: https://github.com/gnudatalanguage/gdl/archive/%{commit}/gdl-%{version}-git-%{shortcommit}.tar.gz
|
||||||
Source1: gdl.csh
|
Source1: gdl.csh
|
||||||
Source2: gdl.sh
|
Source2: gdl.sh
|
||||||
Source4: xorg.conf
|
Source4: xorg.conf
|
||||||
# Build with system antlr library. Request for upstream change here:
|
# Build with system antlr library. Request for upstream change here:
|
||||||
# https://sourceforge.net/tracker/index.php?func=detail&aid=2685215&group_id=97659&atid=618686
|
# https://sourceforge.net/tracker/index.php?func=detail&aid=2685215&group_id=97659&atid=618686
|
||||||
Patch1: gdl-antlr.patch
|
Patch1: gdl-antlr.patch
|
||||||
# Support python3
|
# Fix install directory for drivers
|
||||||
# https://github.com/gnudatalanguage/gdl/pull/468
|
Patch2: https://patch-diff.githubusercontent.com/raw/gnudatalanguage/gdl/pull/1486.patch
|
||||||
Patch2: gdl-python3.patch
|
Patch3: gdl-size.patch
|
||||||
# Fix conflict with std::vector and ALTIVEC vector
|
|
||||||
# https://github.com/gnudatalanguage/gdl/pull/535
|
|
||||||
Patch4: gdl-std.patch
|
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: antlr-C++
|
BuildRequires: antlr-C++
|
||||||
BuildRequires: antlr-tool
|
BuildRequires: antlr-tool
|
||||||
|
%if %{with java}
|
||||||
BuildRequires: java-devel
|
BuildRequires: java-devel
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?rhel} == 6
|
BuildRequires: eigen3-static
|
||||||
BuildRequires: antlr
|
BuildRequires: expat-devel
|
||||||
BuildRequires: java
|
BuildRequires: fftw-devel
|
||||||
%endif
|
BuildRequires: glpk-devel
|
||||||
BuildRequires: readline-devel, ncurses-devel
|
BuildRequires: GraphicsMagick-c++-devel
|
||||||
BuildRequires: gsl-devel, plplot-devel, GraphicsMagick-c++-devel
|
BuildRequires: gsl-devel
|
||||||
BuildRequires: netcdf-devel, hdf5-devel, libjpeg-devel
|
BuildRequires: hdf-static
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 8
|
BuildRequires: hdf5-devel
|
||||||
BuildRequires: python%{python3_pkgversion}-devel, python%{python3_pkgversion}-numpy, python%{python3_pkgversion}-matplotlib
|
BuildRequires: libgeotiff-devel
|
||||||
%else
|
BuildRequires: libjpeg-devel
|
||||||
BuildRequires: python2-devel, python2-numpy, python2-matplotlib
|
BuildRequires: libtiff-devel
|
||||||
%endif
|
BuildRequires: libtirpc-devel
|
||||||
|
BuildRequires: ncurses-devel
|
||||||
|
BuildRequires: netcdf-devel
|
||||||
|
BuildRequires: plplot-wxGTK-devel >= 5.11
|
||||||
|
BuildRequires: proj-devel
|
||||||
|
BuildRequires: pslib-devel
|
||||||
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
|
BuildRequires: python%{python3_pkgversion}-numpy
|
||||||
|
BuildRequires: python%{python3_pkgversion}-matplotlib
|
||||||
|
BuildRequires: readline-devel
|
||||||
|
# Not yet possible to build with external dSFMT
|
||||||
|
#BuildRequires: dSFMT-devel
|
||||||
|
Provides: bundled(dSFMT)
|
||||||
BuildRequires: shapelib-devel
|
BuildRequires: shapelib-devel
|
||||||
BuildRequires: fftw-devel, hdf-static
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 8
|
|
||||||
# eccodes not available on these arches
|
# eccodes not available on these arches
|
||||||
%ifnarch i686 ppc64 s390x armv7hl
|
%ifnarch i686 s390x armv7hl
|
||||||
BuildRequires: eccodes-devel
|
BuildRequires: eccodes-devel
|
||||||
%else
|
%else
|
||||||
BuildRequires: grib_api-devel
|
BuildRequires: grib_api-devel
|
||||||
%endif
|
%endif
|
||||||
%else
|
|
||||||
# eccodes not available on these arches
|
|
||||||
%ifnarch i686 ppc64 s390x armv7hl aarch64
|
|
||||||
BuildRequires: eccodes-devel
|
|
||||||
%else
|
|
||||||
BuildRequires: grib_api-static
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
BuildRequires: eigen3-static
|
|
||||||
BuildRequires: libgeotiff-devel
|
|
||||||
BuildRequires: libtiff-devel
|
|
||||||
BuildRequires: libtirpc-devel
|
|
||||||
#TODO - Build with mpi support
|
#TODO - Build with mpi support
|
||||||
#BuildRequires: mpich2-devel
|
#BuildRequires: mpich2-devel
|
||||||
BuildRequires: pslib-devel
|
|
||||||
# qhull too old on Fedora 24 and EPEL7
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 8
|
|
||||||
BuildRequires: qhull-devel
|
BuildRequires: qhull-devel
|
||||||
%global cmake_qhull -DQHULL=ON
|
|
||||||
%endif
|
|
||||||
BuildRequires: udunits2-devel
|
BuildRequires: udunits2-devel
|
||||||
BuildRequires: wxGTK3-devel
|
BuildRequires: wxGTK-devel
|
||||||
BuildRequires: cmake3
|
BuildRequires: cmake3
|
||||||
# For tests
|
# For tests
|
||||||
|
# EL8 s390x missing xorg-x11-drv-dummy
|
||||||
|
%if ! ( 0%{?rhel} >= 8 && "%{_arch}" == "s390x" )
|
||||||
BuildRequires: xorg-x11-drv-dummy
|
BuildRequires: xorg-x11-drv-dummy
|
||||||
BuildRequires: metacity
|
BuildRequires: metacity
|
||||||
|
%endif
|
||||||
|
BuildRequires: make
|
||||||
# Needed to pull in drivers
|
# Needed to pull in drivers
|
||||||
Requires: plplot
|
Requires: plplot
|
||||||
|
# Widgets use wx
|
||||||
|
Recommends: plplot-wxGTK
|
||||||
Requires: %{name}-common = %{version}-%{release}
|
Requires: %{name}-common = %{version}-%{release}
|
||||||
Provides: %{name}-runtime = %{version}-%{release}
|
Provides: %{name}-runtime = %{version}-%{release}
|
||||||
# Need to match hdf5 compile time version
|
# Need to match hdf5 compile time version
|
||||||
@ -99,7 +102,6 @@ BuildArch: noarch
|
|||||||
Common files for GDL
|
Common files for GDL
|
||||||
|
|
||||||
|
|
||||||
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
|
|
||||||
%package -n python%{python3_pkgversion}-gdl
|
%package -n python%{python3_pkgversion}-gdl
|
||||||
%{?python_provide:%python_provide python%{python3_pkgversion}-gdl}
|
%{?python_provide:%python_provide python%{python3_pkgversion}-gdl}
|
||||||
# Remove before F30
|
# Remove before F30
|
||||||
@ -114,30 +116,19 @@ Provides: %{name}-runtime = %{version}-%{release}
|
|||||||
|
|
||||||
%description -n python%{python3_pkgversion}-gdl
|
%description -n python%{python3_pkgversion}-gdl
|
||||||
%{summary}.
|
%{summary}.
|
||||||
%else
|
|
||||||
%package -n python2-gdl
|
|
||||||
%{?python_provide:%python_provide python2-gdl}
|
|
||||||
# Remove before F30
|
|
||||||
Provides: %{name}-python = %{version}-%{release}
|
|
||||||
Provides: %{name}-python%{?_isa} = %{version}-%{release}
|
|
||||||
Obsoletes: %{name}-python < %{version}-%{release}
|
|
||||||
Summary: GDL python module
|
|
||||||
# Needed to pull in drivers
|
|
||||||
Requires: plplot
|
|
||||||
Requires: %{name}-common = %{version}-%{release}
|
|
||||||
Provides: %{name}-runtime = %{version}-%{release}
|
|
||||||
|
|
||||||
%description -n python2-gdl
|
|
||||||
%{summary}.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{commit}
|
%setup -q -n gdl-%{version}
|
||||||
rm -rf src/antlr
|
rm -rf src/antlr
|
||||||
|
# Not yet possible to build with external dSFMT
|
||||||
|
#rm -r src/dSFMT
|
||||||
%patch1 -p1 -b .antlr
|
%patch1 -p1 -b .antlr
|
||||||
%patch2 -p1 -b .python3
|
%patch2 -p1 -b .libdir
|
||||||
%patch4 -p1 -b .std
|
%patch3 -p1 -b .size
|
||||||
|
|
||||||
|
# Find grib_api on architectures where needed
|
||||||
|
sed -i -e '/find_library(GRIB_LIBRARIES/s/eccodes/eccodes grib_api/' CMakeModules/FindGrib.cmake
|
||||||
|
|
||||||
pushd src
|
pushd src
|
||||||
for f in *.g
|
for f in *.g
|
||||||
@ -146,21 +137,15 @@ do
|
|||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
|
|
||||||
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
|
|
||||||
%global __python %{__python3}
|
%global __python %{__python3}
|
||||||
%global python_sitearch %{python3_sitearch}
|
%global python_sitearch %{python3_sitearch}
|
||||||
%else
|
|
||||||
%global __python %{__python2}
|
|
||||||
%global python_sitearch %{python2_sitearch}
|
|
||||||
%endif
|
|
||||||
%global cmake_opts \\\
|
%global cmake_opts \\\
|
||||||
-DWXWIDGETS=ON \\\
|
-DGDL_LIB_DIR:PATH=%{_libdir}/gnudatalanguage \\\
|
||||||
-DGEOTIFF_INCLUDE_DIR=%{_includedir}/libgeotiff \\\
|
-DGEOTIFF_INCLUDE_DIR=%{_includedir}/libgeotiff \\\
|
||||||
-DUDUNITS=ON \\\
|
|
||||||
-DUDUNITS_INCLUDE_DIR=%{_includedir}/udunits2 \\\
|
|
||||||
-DGRIB=ON \\\
|
-DGRIB=ON \\\
|
||||||
-DOPENMP=ON \\\
|
-DOPENMP=ON \\\
|
||||||
-DPYTHON_EXECUTABLE=%{__python} \\\
|
-DPYTHON_EXECUTABLE=%{__python} \\\
|
||||||
|
-DWXWIDGETS=ON \\\
|
||||||
%{?cmake_qhull} \\\
|
%{?cmake_qhull} \\\
|
||||||
%{nil}
|
%{nil}
|
||||||
# TODO - build an mpi version
|
# TODO - build an mpi version
|
||||||
@ -168,6 +153,11 @@ popd
|
|||||||
# --with-mpich=%{_libdir}/mpich2 \
|
# --with-mpich=%{_libdir}/mpich2 \
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
export CXXFLAGS="%optflags -fcommon"
|
||||||
|
%ifarch %{arm}
|
||||||
|
# Work around https://github.com/gnudatalanguage/gdl/issues/677
|
||||||
|
export LDFLAGS="%{build_ldflags} -Wl,--allow-multiple-definition"
|
||||||
|
%endif
|
||||||
mkdir build build-python
|
mkdir build build-python
|
||||||
#Build the standalone executable
|
#Build the standalone executable
|
||||||
pushd build
|
pushd build
|
||||||
@ -183,30 +173,28 @@ popd
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
pushd build
|
pushd build
|
||||||
make install DESTDIR=$RPM_BUILD_ROOT
|
%make_install
|
||||||
popd
|
popd
|
||||||
pushd build-python
|
pushd build-python
|
||||||
make install DESTDIR=$RPM_BUILD_ROOT
|
%make_install
|
||||||
# Install the python module in the right location
|
# Install the python module in the right location
|
||||||
install -d -m 0755 $RPM_BUILD_ROOT/%{python_sitearch}
|
install -d -m 0755 $RPM_BUILD_ROOT%{python_sitearch}
|
||||||
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
|
%if "%{_lib}" != "lib"
|
||||||
%if %{_lib} != "lib"
|
|
||||||
mv $RPM_BUILD_ROOT%{_prefix}/lib/python*/site-packages/GDL.so \
|
mv $RPM_BUILD_ROOT%{_prefix}/lib/python*/site-packages/GDL.so \
|
||||||
$RPM_BUILD_ROOT%{python_sitearch}/GDL.so
|
$RPM_BUILD_ROOT%{python_sitearch}/GDL.so
|
||||||
%endif
|
%endif
|
||||||
%else
|
|
||||||
mv $RPM_BUILD_ROOT%{_prefix}/lib/site-python/GDL.so \
|
|
||||||
$RPM_BUILD_ROOT%{python_sitearch}/GDL.so
|
|
||||||
%endif
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Install the profile file to set GDL_PATH
|
# Install the profile file to set GDL_PATH
|
||||||
install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d
|
install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
|
||||||
install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d
|
install -m 0644 %SOURCE1 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
|
||||||
install -m 0644 %SOURCE2 $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d
|
install -m 0644 %SOURCE2 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
|
||||||
|
|
||||||
|
|
||||||
|
# EL8 s390x missing xorg-x11-drv-dummy
|
||||||
|
%if ! ( 0%{?rhel} >= 8 && "%{_arch}" == "s390x" )
|
||||||
%check
|
%check
|
||||||
|
export GDL_DRV_DIR=$RPM_BUILD_ROOT%{_libdir}/gnudatalanguage
|
||||||
cd build
|
cd build
|
||||||
cp %SOURCE4 .
|
cp %SOURCE4 .
|
||||||
if [ -x /usr/libexec/Xorg ]; then
|
if [ -x /usr/libexec/Xorg ]; then
|
||||||
@ -223,79 +211,142 @@ export DISPLAY=:99
|
|||||||
|
|
||||||
metacity &
|
metacity &
|
||||||
sleep 2
|
sleep 2
|
||||||
# bytscl - https://github.com/gnudatalanguage/gdl/issues/159
|
# byte_conversion/bytscl - https://github.com/gnudatalanguage/gdl/issues/1079
|
||||||
# device - Failed on EL7
|
# test_l64 - https://github.com/gnudatalanguage/gdl/issues/1075
|
||||||
# fft_leak - https://github.com/gnudatalanguage/gdl/issues/147
|
|
||||||
# file_delete - https://github.com/gnudatalanguage/gdl/issues/148
|
|
||||||
# file_test - https://github.com/gnudatalanguage/gdl/issues/534
|
|
||||||
# fix - https://github.com/gnudatalanguage/gdl/issues/149
|
|
||||||
# formats - https://github.com/gnudatalanguage/gdl/issues/144
|
|
||||||
# get_screen_size - Failed on EL7
|
|
||||||
# n_tags - https://github.com/gnudatalanguage/gdl/issues/150
|
|
||||||
# parse_url - https://github.com/gnudatalanguage/gdl/issues/153
|
|
||||||
# resolve_routine - https://github.com/gnudatalanguage/gdl/issues/146
|
|
||||||
# rounding - https://github.com/gnudatalanguage/gdl/issues/154
|
|
||||||
# total - https://github.com/gnudatalanguage/gdl/issues/155
|
|
||||||
failing_tests='test_(bytscl|device|fft_leak|file_(delete|test)|finite|fix|formats|get_screen_size|idlneturl|make_dll|n_tags|parse_url|resolve_routine|rounding|total|wait)'
|
|
||||||
%ifarch aarch64 ppc %{power64}
|
|
||||||
# test_fix fails currently on arm
|
|
||||||
# https://sourceforge.net/p/gnudatalanguage/bugs/622/
|
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=990749
|
|
||||||
failing_tests="$failing_tests|test_(fix|hdf5)"
|
|
||||||
%endif
|
|
||||||
%ifarch aarch64
|
%ifarch aarch64
|
||||||
# new test failues - indgen, list - https://github.com/gnudatalanguage/gdl/issues/372
|
failing_tests="test_(byte_conversion|bytscl)"
|
||||||
# Bug tests hang on F28
|
|
||||||
failing_tests="$failing_tests|test_(bug_(3104209|3104326|3147733)|file_lines|indgen|list|l64|step|xdr)"
|
|
||||||
%endif
|
%endif
|
||||||
%ifarch %{arm}
|
%ifarch %{arm}
|
||||||
# These fail on 32-bit: test_formats test_xdr
|
failing_tests="test_(byte_conversion|bytscl|l64)"
|
||||||
failing_tests="$failing_tests|test_(file_lines|fix|formats|hdf5|indgen|list|l64|xdr)"
|
|
||||||
%endif
|
%endif
|
||||||
%ifarch %{ix86}
|
%ifarch %{ix86}
|
||||||
# binfmt - https://github.com/gnudatalanguage/gdl/issues/332
|
failing_tests="test_l64"
|
||||||
# These fail on 32-bit: test_formats test_xdr
|
|
||||||
failing_tests="$failing_tests|test_(formats|l64|sem|xdr)"
|
|
||||||
%endif
|
|
||||||
%ifarch ppc64
|
|
||||||
# new test failues - indgen, list - https://github.com/gnudatalanguage/gdl/issues/372
|
|
||||||
failing_tests="$failing_tests|test_(bug_(635|3104209|3147733)|file_lines|indgen|list|save_restore|window_background)"
|
|
||||||
%endif
|
%endif
|
||||||
%ifarch ppc64le
|
%ifarch ppc64le
|
||||||
# ppc64le - test_file_lines https://github.com/gnudatalanguage/gdl/issues/373
|
failing_tests="test_(byte_conversion|bytscl|finite|matrix_multiply)"
|
||||||
failing_tests="$failing_tests|test_(angles|bug_(3104209|3104326)|container|file_lines|hdf5|hist_2d|indgen|list|random)"
|
|
||||||
%endif
|
%endif
|
||||||
%ifarch s390x
|
%ifarch s390x
|
||||||
failing_tests="$failing_tests|test_(bug_635|deriv|file_lines|hdf5|indgen|list|save_restore|tic_toc|window_background)"
|
# test_hdf5 - https://github.com/gnudatalanguage/gdl/issues/1488
|
||||||
%endif
|
failing_tests="test_(byte_conversion|bytsc|hdf5)"
|
||||||
make check VERBOSE=1 ARGS="-V -E '$failing_tests'"
|
|
||||||
%ifnarch ppc64 s390x
|
|
||||||
# test_save_restore hangs on ppc64 s390x
|
|
||||||
make check VERBOSE=1 ARGS="-V -R '$failing_tests' --timeout 600" || :
|
|
||||||
%endif
|
%endif
|
||||||
|
make test VERBOSE=1 ARGS="-V -E '$failing_tests'"
|
||||||
|
make test VERBOSE=1 ARGS="-V -R '$failing_tests' --timeout 600" || :
|
||||||
kill %1 || :
|
kill %1 || :
|
||||||
cat xorg.log
|
cat xorg.log
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc AUTHORS ChangeLog HACKING NEWS README
|
%doc AUTHORS HACKING NEWS README
|
||||||
%config(noreplace) %{_sysconfdir}/profile.d/gdl.*sh
|
%config(noreplace) %{_sysconfdir}/profile.d/gdl.*sh
|
||||||
%{_bindir}/gdl
|
%{_bindir}/gdl
|
||||||
|
%{_libdir}/gnudatalanguage/
|
||||||
%{_mandir}/man1/gdl.1*
|
%{_mandir}/man1/gdl.1*
|
||||||
|
|
||||||
%files common
|
%files common
|
||||||
%{_datadir}/gnudatalanguage/
|
%{_datadir}/gnudatalanguage/
|
||||||
|
|
||||||
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
|
|
||||||
%files -n python%{python3_pkgversion}-gdl
|
%files -n python%{python3_pkgversion}-gdl
|
||||||
%else
|
|
||||||
%files -n python2-gdl
|
|
||||||
%endif
|
|
||||||
%{python_sitearch}/GDL.so
|
%{python_sitearch}/GDL.so
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun Jan 22 2023 Orion Poplawski <orion@nwra.com> - 1.0.2-1
|
||||||
|
- Update to 1.0.2
|
||||||
|
- Use SPDX License tag
|
||||||
|
|
||||||
|
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-12
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Nov 15 2022 Scott Talbert <swt@techie.net> - 1.0.1-11
|
||||||
|
- Rebuild with wxWidgets 3.2
|
||||||
|
|
||||||
|
* Sat Nov 05 2022 Orion Poplawski <orion@nwra.com> - 1.0.1-10
|
||||||
|
- Re-enable LTO on ppc64le
|
||||||
|
|
||||||
|
* Tue Aug 23 2022 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.0.1-9
|
||||||
|
- Rebuild for gsl-2.7.1
|
||||||
|
|
||||||
|
% Thu Jul 21 2022 Orion Poplawski <orion@nwra.com> - 1.0.1-8
|
||||||
|
- Drop i686 completely - no antlr support
|
||||||
|
|
||||||
|
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Jul 10 2022 Orion Poplawski <orion@nwra.com> - 1.0.1-7
|
||||||
|
- Drop java for i686 (bz#2104042)
|
||||||
|
|
||||||
|
* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 1.0.1-6
|
||||||
|
- Rebuilt for Python 3.11
|
||||||
|
|
||||||
|
* Thu Mar 10 2022 Sandro Mani <manisandro@gmail.com> - 1.0.1-5
|
||||||
|
- Rebuild for proj-9.0.0
|
||||||
|
|
||||||
|
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 1.0.1-4
|
||||||
|
- Rebuilt for java-17-openjdk as system jdk
|
||||||
|
|
||||||
|
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Nov 22 2021 Orion Poplawski <orion@nwra.com> - 1.0.1-2
|
||||||
|
- Rebuild for hdf5 1.12.1
|
||||||
|
|
||||||
|
* Mon Oct 18 2021 Orion Poplawski <orion@nwra.com> - 1.0.1-1
|
||||||
|
- Update to 1.0.1
|
||||||
|
|
||||||
|
* Thu Aug 26 2021 Orion Poplawski <orion@nwra.com> - 1.0.0-2
|
||||||
|
- Re-enable armv7hl; add ppc64le eigen workaround; Cleanup test exclusions
|
||||||
|
|
||||||
|
* Sun Aug 22 2021 Orion Poplawski <orion@nwra.com> - 1.0.0-1
|
||||||
|
- Update to 1.0.0
|
||||||
|
- Drop EL7 support due to plplot 5.11 requirement
|
||||||
|
|
||||||
|
* Tue Aug 10 2021 Orion Poplawski <orion@nwra.com> - 1.0.0-0.6.20210123git4892c96
|
||||||
|
- Rebuild for hdf5 1.10.7/netcdf 4.8.0
|
||||||
|
|
||||||
|
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-0.5.20210123git4892c96
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.0.0-0.4.20210123git4892c96
|
||||||
|
- Rebuilt for Python 3.10
|
||||||
|
|
||||||
|
* Sat Mar 13 2021 Orion Poplawski <orion@nwra.com> - 1.0.0-0.3.20210123git4892c96
|
||||||
|
- Add patch for PROJ 8 support
|
||||||
|
|
||||||
|
* Sun Mar 07 2021 Sandro Mani <manisandro@gmail.com> - 1.0.0-0.3.20210123git4892c96
|
||||||
|
- Rebuild (proj)
|
||||||
|
|
||||||
|
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-0.2.20210123git4892c96
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sun Jan 24 2021 Orion Poplawski <orion@nwra.com> - 1.0.0-0.1.20210123git4892c96
|
||||||
|
- Update to latest git
|
||||||
|
|
||||||
|
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.9-20.20190915git2870075
|
||||||
|
- Second attempt - Rebuilt for
|
||||||
|
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.9-19.20190915git2870075
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jul 14 2020 Tom Stellard <tstellar@redhat.com> - 0.9.9-18.20190915git2870075
|
||||||
|
- Use make macros
|
||||||
|
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
|
||||||
|
|
||||||
|
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 0.9.9-17.20190915git2870075
|
||||||
|
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
|
||||||
|
|
||||||
|
* Fri Jun 26 2020 Orion Poplawski <orion@nwra.com> - 0.9.9-16.20190915git2870075
|
||||||
|
- Rebuild for hdf5 1.10.6
|
||||||
|
|
||||||
|
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.9.9-15.20190915git2870075
|
||||||
|
- Rebuilt for Python 3.9
|
||||||
|
|
||||||
|
* Thu Apr 02 2020 Björn Esser <besser82@fedoraproject.org> - 0.9.9-14.20190915git2870075
|
||||||
|
- Fix string quoting for rpm >= 4.16
|
||||||
|
- Add BR: expat-devel
|
||||||
|
|
||||||
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.9-13.20190915git2870075
|
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.9-13.20190915git2870075
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||||
|
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (gdl-0.9.9-git-2870075.tar.gz) = f23519a1981d9d8b876220cc2d2d4568edada963242d8a6c94f543f83e35af1b36dadf75ddbae772b62bc0d8714fcdb144e562777867091702aaff8dd476d1d5
|
SHA512 (gdl-1.0.2.tar.gz) = 19869b68343ae8532ec9e27c402f69986d8269cc1f4c6af55402bef74f6dbee88c82b4c67db093b3be63377afb9a9a870f7baf484c8278d54ee5a7b5a428206a
|
||||||
|
Loading…
Reference in New Issue
Block a user