Skip to content

Commit 0a0fed4

Browse files
committed
avoid using VERSION.cmake
Former-commit-id: 47f0163f021f7c4ea4e26d2c6c9e58cf97a333f4
1 parent 4439e60 commit 0a0fed4

File tree

11 files changed

+29
-84
lines changed

11 files changed

+29
-84
lines changed

ACore/doc/extracting_version_number.ddoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# ==============================================================================================
2-
# We extract version number for $WK/VERSION.cmake file.
3-
# cmake will also generate a header file, for inclusion.
2+
# We extract version number for $WK/ACore/src/ecflow_version.h this is a generated file.
43
#
54
cd $WK
6-
release=$(cat VERSION.cmake | grep 'set( ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
7-
major=$(cat VERSION.cmake | grep 'set( ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
8-
minor=$(cat VERSION.cmake | grep 'set( ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
5+
release=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
6+
major=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
7+
minor=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
98
ECFLOW_VERSION=$release.$major.$minor
109

1110

ACore/src/File.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ std::string File::root_source_dir()
986986
// bjam
987987
fs::path current_path = fs::current_path();
988988
std::string the_current_path = current_path.string();
989-
std::string version_cmake = the_current_path + "/VERSION.cmake";
989+
std::string version_cmake = the_current_path + "/Jamroot.jam";
990990
if (fs::exists(version_cmake)) {
991991
return the_current_path;
992992
}
@@ -997,7 +997,7 @@ std::string File::root_source_dir()
997997
current_path = current_path.parent_path();
998998

999999
// bjam
1000-
std::string version_cmake = std::string(current_path.string()) + "/VERSION.cmake";
1000+
std::string version_cmake = std::string(current_path.string()) + "/Jamroot.jam";
10011001
if (fs::exists(version_cmake)) {
10021002
std::string the_root_source_dir = current_path.string(); // cos current_path.string() is returned by reference
10031003
return the_root_source_dir;
@@ -1021,7 +1021,7 @@ std::string File::root_build_dir()
10211021
std::string the_current_path = current_path.string();
10221022

10231023
// bjam
1024-
std::string version_cmake = the_current_path + "/VERSION.cmake";
1024+
std::string version_cmake = the_current_path + "/Jamroot.jam";
10251025
if (fs::exists(version_cmake)) return the_current_path;
10261026

10271027
// cmake
@@ -1037,7 +1037,7 @@ std::string File::root_build_dir()
10371037
the_current_path = current_path.string(); // cos current_path.string() is returned by reference
10381038

10391039
// bjam
1040-
std::string version_cmake = the_current_path + "/VERSION.cmake";
1040+
std::string version_cmake = the_current_path + "/Jamroot.jam";
10411041
if (fs::exists(version_cmake)) return the_current_path;
10421042

10431043
// cmake

ACore/src/Version.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@ namespace ecf {
2525
// see ACore/doc/extracting_version_number.ddoc
2626
//
2727
// See ACore/src/ecflow_version.h"
28-
// This file is generated from $WK/VERSION.cmake when cmake is run, i.e
28+
// This file is generated when cmake is run, i.e
2929
// sh -x $WK/cmake.sh debug
3030
//
31-
// It is also extracted by python, from VERSION.CMAKE check build_scripts/nightly/build.py
32-
// This minimises the places where we have hard code the version number.
33-
//
3431
// When changing the version change remember to:
3532
// - re-login into remote system to update ECFLOW_INSTALL_DIR & ECFLOW_PYTHON_INSTALL_DIR
3633
// required for interactive install

Jamroot.jam

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ constant ECFLOW_SHARED_DIR : $(ECFLOW_DESTDIR)$(ECFLOW_INSTALL_DIR)/share/ecflow
8585
#echo "ECFLOW_PYTHON_INSTALL_DIR = '$(ECFLOW_PYTHON_INSTALL_DIR)'" ;
8686
#echo "ECFLOW_SHARED_DIR = '$(ECFLOW_SHARED_DIR)'" ;
8787

88-
#
88+
# ** NO LONGER used **
8989
# Allow the installation directory be be defined externally, by the environment variable ECFLOW_INSTALL_DIR
9090
#
9191
# However we want this to be explicit, as we dont need it on a day to day basis.
@@ -105,9 +105,6 @@ constant ECFLOW_SHARED_DIR : $(ECFLOW_DESTDIR)$(ECFLOW_INSTALL_DIR)/share/ecflow
105105
# Note: Not all system have XLib, hence install ecFlowview manually by using:
106106
# bjam -d2 install-viewer
107107
#
108-
# Make sure for ECMWF that ECFLOW_INSTALL_DIR leaf directory encompasses version number
109-
# that ties up with $WK/VERSION.cmake
110-
#
111108

112109
# Do no call this on the command line, prefer bjam install-all || install-viewer
113110
# If this is called in isolation ldd will show the referenced shared lib as missing

Pyext/migrate/py_u_TestMigrate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def get_root_source_dir():
1818
if tail.find("ecflow") != -1 :
1919

2020
# bjam, already at the source directory
21-
if os.path.exists(cwd + "/VERSION.cmake"):
22-
print(" Found VERSION.cmake in " + cwd)
21+
if os.path.exists(cwd + "/Jamroot.jam"):
22+
print(" Found Jamroot.jam in " + cwd)
2323
return cwd
2424

2525
if tail != "Pyext" and tail != "migrate":

Pyext/samples/TestBench.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def get_root_source_dir():
3939
if tail.find("ecflow") != -1 :
4040

4141
# bjam, already at the source directory
42-
if os.path.exists(cwd + "/VERSION.cmake"):
43-
print(" Found VERSION.cmake in " + cwd)
42+
if os.path.exists(cwd + "/Jamroot.jam"):
43+
print(" Found Jamroot.jam in " + cwd)
4444
return cwd
4545

4646
if tail != "Pyext" and tail != "migrate":

SCRATCH/src/tmp.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

build_scripts/cray_fix/swap.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ fi
8282
# =================================================================================================
8383
# Determine the release,major,minor numbers for this version
8484
cd $WK
85-
release=$(cat VERSION.cmake | grep 'set( ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
86-
major=$(cat VERSION.cmake | grep 'set( ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
87-
minor=$(cat VERSION.cmake | grep 'set( ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
85+
release=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
86+
major=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
87+
minor=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
8888
ECFLOW_VERSION=$release.$major.$minor
89-
89+
9090
export ECFLOW_INSTALL_DIR=/usr/local/apps/ecflow/$release.$major.$minor
9191
export ECFLOW_PYTHON_INSTALL_DIR=$ECFLOW_INSTALL_DIR/lib/python/2.7/site-packages/ecflow
9292

build_scripts/tar_ecflow.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ find . -name massif.out.\* -exec rm -rf massif.out.* {} \; -print
6767
# Determine ecflow build directory name: see ACore/doc/extracting_version_number.ddoc
6868
# ========================================================================
6969
cd $WK
70-
71-
release=$(cat VERSION.cmake | grep 'set( ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
72-
major=$(cat VERSION.cmake | grep 'set( ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
73-
minor=$(cat VERSION.cmake | grep 'set( ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
70+
release=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
71+
major=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
72+
minor=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
7473

7574
ECFLOW_WS_DIR=ecflow_${release}_${major}_${minor}
7675

cmake.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,6 @@ else
218218
cmake_build_type=Release
219219
fi
220220

221-
# ====================================================================================
222-
# Use for local install
223-
release=$(cat VERSION.cmake | grep 'set( ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
224-
major=$(cat VERSION.cmake | grep 'set( ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
225-
minor=$(cat VERSION.cmake | grep 'set( ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
226221

227222
# ====================================================================================
228223
# clean up source before packaging, do this after deleting ecbuild
@@ -323,6 +318,11 @@ if [[ $package_source_arg = package_source ]] ; then
323318
gui_options=
324319
fi
325320

321+
# ====================================================================================
322+
# Use for local install
323+
release=$(cat VERSION.cmake | grep 'set( ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
324+
major=$(cat VERSION.cmake | grep 'set( ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
325+
minor=$(cat VERSION.cmake | grep 'set( ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
326326
install_prefix=/var/tmp/$USER/install/cmake/ecflow/$release.$major.$minor
327327

328328
ecbuild=ecbuild

version.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
release=$(cat VERSION.cmake | grep 'set( ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
2-
major=$(cat VERSION.cmake | grep 'set( ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
3-
minor=$(cat VERSION.cmake | grep 'set( ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
1+
release=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_RELEASE' | awk '{print $3}'| sed 's/["]//g')
2+
major=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_MAJOR' | awk '{print $3}'| sed 's/["]//g')
3+
minor=$(cat ACore/src/ecflow_version.h | grep 'ECFLOW_MINOR' | awk '{print $3}'| sed 's/["]//g')
44
ecflow_version=$release.$major.$minor
55

66
# use tr -d '\12' to remove trailing newline

0 commit comments

Comments
 (0)