Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing scons and adding an error message #73

Merged
merged 11 commits into from
Apr 4, 2023
13 changes: 0 additions & 13 deletions apps/texttest/weekly/MeshConvert/Tutorial.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ our special binary version of the Triangle/Tetgen format.
to containing element indices. The presence of this file cuts the calculation cost at mesh load time.
* If a Chaste format fibre file (.axi or .ortho) is associated with the mesh then this will also be converted to our binary format.

=== Making the executable(s) ===
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really wants replacing with cmake example rather than just deleting

Copy link
Contributor Author

@MauriceHendrix MauriceHendrix Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought naking standalone excutables wasn't possible anymore? @fcooper8472 ? unless I have missunderstood?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't try and make them for people due to difficulties getting compatible cross-platform ones for Linux (used to generate the cardiac executable for download) but still should be able to make them (like ApPredict).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's still absolutely possible. We no longer ship a cardiac executable that you can expect to run portably without compiling it yourself, but the top level apps directory (and indeed the apps directory in any user project) can have standalone executables with their own int main() methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok but how do we write that in the tutorial?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would just be the corresponding instructions but using CMake, I suppose?

scons chaste_libs=1 compile_only=1 exe=1 build=GccOpt apps

would become, assuming you have configured Chaste

make Chaste

or

make MeshConvert

and the build=GccOpt_ndebug equivalent would be passing -DCMAKE_BUILD_TYPE=Release at configure time.


It is assumed that as you are running on a parallel cluster or supercomputer you have access to the Chaste
source code. You can produce all executables (including the standalone Chaste program) using:
{{{
#!sh
scons chaste_libs=1 compile_only=1 exe=1 build=GccOpt apps
}}}
Binaries {{{Chaste, MeshConvert...}}} are made in {{{apps/src}}}.

You may get a speed improvement from using a "no debug" build-type like {{{build=GccOpt_ndebug}}}, but
this is at the expense of doing less error checking.

=== Running the converter ===

You may want to download and save the attached file [attachment:MeshConvert.tgz MeshConvert.tgz] and
Expand Down
45 changes: 0 additions & 45 deletions apps/texttest/weekly/UsingCellmlFiles/output.chaste

This file was deleted.

7 changes: 1 addition & 6 deletions chaste-lucid.supp
MauriceHendrix marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
#############################################################

#################################################
# Note if memory leaks depend on the context (e.g.
# CHASTE_TEST_OUTPUT it may be advisable for Scons
# to produce suppressions automatically:
# python/BuildTypes.py
# - #_valgrind_flags +=" --gen-suppressions=all"
# + _valgrind_flags +=" --gen-suppressions=all"
# Note if memory leaks depend on the context
#################################################

# HDF5
Expand Down
7 changes: 1 addition & 6 deletions chaste.supp
MauriceHendrix marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
# valgrind --tool=memcheck --track-fds=yes --leak-check=yes --num-callers=50 --suppressions=chaste.supp --gen-suppressions=yes io/build/debug/TestSpiralParametersReaderRunner

#################################################
# Note if memory leaks depend on the context (e.g.
# CHASTE_TEST_OUTPUT it may be advisable for Scons
# to produce suppressions automatically:
# python/BuildTypes.py
# - #_valgrind_flags +=" --gen-suppressions=all"
# + _valgrind_flags +=" --gen-suppressions=all"
# Note if memory leaks depend on the context
#################################################


Expand Down
3 changes: 0 additions & 3 deletions crypt/test/simulation/TestArchiveFormat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ class TestArchiveFormat : public CxxTest::TestSuite
* ctest -R TestGenerateSteadyStateCrypt
* cp /tmp/$USER/testoutput/SteadyStateCrypt/archive/?*_150.* ../crypt/test/data/SteadyStateCrypt/archive/
*
* OR to produce archives in CMake:
* scons build=GccOpt_hostconfig,boost=1-58,use-cvode=0 test_suite=crypt/test/simulation/TestGenerateSteadyStateCrypt.hpp
* cp /tmp/$USER/testoutput/SteadyStateCrypt/archive/?*_150.* crypt/test/data/SteadyStateCrypt/archive/
*
*/
void TestLoadArchive()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="test_suite=${resource_loc}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/usr/bin/scons"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
</launchConfiguration>
2 changes: 0 additions & 2 deletions eclipse_settings/preferences.epf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ file_export_version=3.0
/instance/org.eclipse.core.resources/encoding=ISO-8859-1
/instance/org.eclipse.core.resources/version=1
/instance/org.eclipse.core.runtime/content-types/org.eclipse.cdt.core.cxxSource/file-names=*.cpp.in
/instance/org.eclipse.core.runtime/content-types/org.python.pydev.pythonfile/file-names=SConscript
/instance/org.eclipse.debug.ui/org.eclipse.debug.ui.build_before_launch=false
/instance/org.eclipse.team.svn.ui/preference.decoration.icon.modified=true
/instance/org.eclipse.team.svn.ui/preference.history.connectToCompareWith=false
Expand All @@ -40,7 +39,6 @@ file_export_version=3.0
/instance/org.eclipse.ui.editors/spacesForTabs=true
/instance/org.eclipse.ui.ide/EXIT_PROMPT_ON_CLOSE_LAST_WINDOW=false
/instance/org.eclipse.ui.workbench/perspectives=<C/C++>
/instance/org.eclipse.ui.workbench/resourcetypes=<?xml version\="1.0" encoding\="UTF-8"?>\n<editors version\="3.1">\n<info extension\="" name\="SConstruct">\n<editor id\="org.python.pydev.editor.PythonEditor"/>\n<defaultEditor id\="org.python.pydev.editor.PythonEditor"/>\n</info>\n<info extension\="" name\="SConscript">\n<editor id\="org.python.pydev.editor.PythonEditor"/>\n<defaultEditor id\="org.python.pydev.editor.PythonEditor"/>\n</info>\n</editors>
/instance/org.python.pydev/COMMENT_COLOR=128,128,128
/instance/org.python.pydev/DOCSTRING\ CHARACTER="
/instance/org.python.pydev/DONT_GENERATE_TYPETAGS_PREFIXES=sz\u0000n\u0000f\u0000
Expand Down
2 changes: 1 addition & 1 deletion global/src/OutputFileHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ std::string OutputFileHandler::GetChasteTestOutputDirectory()
FileFinder directory_root;
if (chaste_test_output == nullptr || *chaste_test_output == 0)
{
// Mimic the old SCons behaviour of setting CHASTE_TEST_OUTPUT: /tmp/'+os.environ['USER']+'/testoutput/
// Mimic the old behaviour of setting CHASTE_TEST_OUTPUT: /tmp/'+os.environ['USER']+'/testoutput/
std::stringstream tmp_directory;
if (getenv("USER")!=NULL)
{
Expand Down
1 change: 0 additions & 1 deletion global/src/Version.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This is a template file for generating the Version.cpp source on the fly.
* Content of the form %(example)s is replaced by suitable values.
* See the function GetVersionCpp in python/SConsTools.py for more details.
*/

#include "Version.hpp"
Expand Down
1 change: 0 additions & 1 deletion global/src/Version_cmake.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This is a template file for generating the Version.cpp source on the fly.
* Content of the form ${example} is replaced by suitable values.
* See the function GetVersionCpp in python/SConsTools.py for more details.
*/

#include "Version.hpp"
Expand Down
7 changes: 0 additions & 7 deletions global/test/TestCommandLineArguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
*
* For example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really wants replacing with cmake example rather than just deleting

* scons co=1 projects/you/TestBlah.hpp
* ./projects/you/build/debug/TestBlahRunner -myparam 10.4
*
* Alternatively, you can add the arguments to SCons so that you can compile and run in one go:
* scons run_time_flags="--verbose true" global/test/TestCommandLineArguments.hpp
* This should produce "You have successfully set --verbose to take the value 1." for this test suite.
*
* Note: error messages such as
* WARNING! There are options you set that were not used!
Expand Down
1 change: 0 additions & 1 deletion global/test/TestFileFinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ class TestFileFinder : public CxxTest::TestSuite

// We can also compute relative paths
TS_ASSERT_EQUALS(child.GetRelativePath(dir), "src/");
TS_ASSERT_EQUALS(FileFinder("SConscript", dir).GetRelativePath(dir), "SConscript");
TS_ASSERT_THROWS_CONTAINS(child.GetRelativePath(new_dir), "' is not relative to '");
}

Expand Down
3 changes: 1 addition & 2 deletions heart/src/io/ChasteParameters_2017_1.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@
<xs:documentation xml:lang="en"> An attribute for path_type elements that describes how to
interpret the path value. It can be relative to the current working directory, relative to
$CHASTE_TEST_OUTPUT, relative to the parameters file, relative to the Chaste source
code root, relative to the directory Chaste was built in (which for SCons builds is the same
as the source root, but may differ for CMake builds), or an absolute path. It can also be
code root, relative to the directory Chaste was built in, or an absolute path. It can also be
specified as a path relative to the XML configuration file. </xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
Expand Down
3 changes: 1 addition & 2 deletions heart/src/io/ChasteParameters_3_4.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@
<xs:documentation xml:lang="en"> An attribute for path_type elements that describes how to
interpret the path value. It can be relative to the current working directory, relative to
$CHASTE_TEST_OUTPUT, relative to the parameters file, relative to the Chaste source
code root, relative to the directory Chaste was built in (which for SCons builds is the same
as the source root, but may differ for CMake builds), or an absolute path. It can also be
code root, relative to the directory Chaste was built in, or an absolute path. It can also be
specified as a path relative to the XML configuration file. </xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
Expand Down
20 changes: 0 additions & 20 deletions heart/src/odes/CellMLToSharedLibraryConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ void CellMLToSharedLibraryConverter::ConvertCellmlToSo(const std::string& rCellm
r_cellml_file.CopyTo(tmp_folder);
}

#ifdef CHASTE_CMAKE
std::string cmake_lists_filename = tmp_folder.GetAbsolutePath() + "/CMakeLists.txt";
std::ofstream cmake_lists_filestream(cmake_lists_filename.c_str());
cmake_lists_filestream << "cmake_minimum_required(VERSION 2.8.12)\n" <<
Expand All @@ -219,25 +218,6 @@ void CellMLToSharedLibraryConverter::ConvertCellmlToSo(const std::string& rCellm
EXPECT0(chdir, tmp_folder.GetAbsolutePath());
EXPECT0(system, "cmake" + cmake_args + " .");
EXPECT0(system, "cmake --build . --config " + ChasteBuildType());
#else
// Change to Chaste source folder
EXPECT0(chdir, chaste_root.GetAbsolutePath());

// Run scons to generate C++ code and compile it to a .so
EXPECT0(system, "scons --warn=no-all dyn_libs_only=1 chaste_libs=1 --codegen_args=\""+codegen_args+"\" --codegen_base_folder=" + chaste_source.GetAbsolutePath() + " build=" + ChasteBuildType() + " " + tmp_folder.GetAbsolutePath());
if (mPreserveGeneratedSources)
{
// Copy the generated source (.hpp and .cpp) to the same place as the .so file is going.
// NB. CMake does this by default
FileFinder destination_folder_for_sources(rCellmlFolder, RelativeTo::Absolute);
// Copy generated source code as well
std::vector<FileFinder> generated_files = build_folder.FindMatches("*.?pp");
BOOST_FOREACH(const FileFinder& r_generated_file, generated_files)
{
r_generated_file.CopyTo(destination_folder_for_sources);
}
}
#endif

FileFinder so_file(tmp_folder.GetAbsolutePath() + "/lib" + cellml_leaf_name + "." + msSoSuffix, RelativeTo::Absolute);
std::cout<< "so file: "<< tmp_folder.GetAbsolutePath() + "/lib" + cellml_leaf_name + "." + msSoSuffix <<std::endl;
Expand Down
9 changes: 0 additions & 9 deletions heart/test/TestCardiacSimulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,15 +438,6 @@ class TestCardiacSimulation : public CxxTest::TestSuite
/**
* Note: from Chaste release 3.1 onward we no longer support Boost 1.33.
* The earliest version of Boost supported is 1.34
* Run TestCardiacSimulationArchiveBidomain on 4 processors to create the archive for this test,
* and copy it to the repository using:
*
scons build=GccOpt_hostconfig,boost=1-34_4 test_suite=heart/test/TestCardiacSimulation.hpp
cp -r /tmp/$USER/testoutput/SaveBidomainShort_checkpoints/0.2ms heart/test/data/checkpoint_migration_via_xml/
rm -f heart/test/data/checkpoint_migration_via_xml/0.2ms/SaveBidomainShort/progress_status.txt
rm -f heart/test/data/checkpoint_migration_via_xml/0.2ms/SaveBidomainShort_0.2ms/mesh.ncl
rm -f heart/test/data/checkpoint_migration_via_xml/0.2ms/SaveBidomainShort_0.2ms/ChasteParameters_?_?xsd
rm -rf heart/test/data/checkpoint_migration_via_xml/0.2ms/SaveBidomainShort/output
*/
void TestCardiacSimulationResumeMigration()
{
Expand Down
Loading