Skip to content

Commit

Permalink
Merge pull request #31 from virtualcell/nonchombo-build
Browse files Browse the repository at this point in the history
Nonchombo build
  • Loading branch information
jcschaff authored May 25, 2024
2 parents 603ace6 + bb4fe00 commit 8b020bb
Show file tree
Hide file tree
Showing 86 changed files with 1,454 additions and 1,429 deletions.
506 changes: 291 additions & 215 deletions .github/workflows/cd.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/build-dockcross-win64/
/.project
/.cproject
/svnversion.txt
/build-win64/
/.DS_Store
/build-linux64/
Expand All @@ -14,6 +13,7 @@
/singularity/
/cmake-build*
/build*
/debug-build*
/.idea/
/nfsim/
/all_solvers/*
Expand Down
27 changes: 17 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
#
##############################################
if (APPLE)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
execute_process(COMMAND uname -m OUTPUT_VARIABLE PROCESSOR_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
message("Processor Architecture: ${PROCESSOR_ARCHITECTURE}")
if (PROCESSOR_ARCHITECTURE STREQUAL "arm64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__arm64__")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__arm64__")
set(CMAKE_OSX_ARCHITECTURES "arm64")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__x86_64__")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__x86_64__")
set(CMAKE_OSX_ARCHITECTURES "x86_64")
endif()
# set(CMAKE_Fortran_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=10.7" CACHE PATH "")
# set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" CACHE PATH "")
#############################################
Expand All @@ -31,7 +41,7 @@ elseif (LINUX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m64")
endif()
endif()
endif()

cmake_minimum_required(VERSION 3.13)
Expand All @@ -45,10 +55,6 @@ if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif()

set(SVERSION "unversionedbuild")
message("svnversion ${SVERSION}")
add_definitions(-DSVNVERSION=svn${SVERSION})

#include (LocalJNI.cmake)

set(RULE_MESSAGES OFF)
Expand Down Expand Up @@ -152,10 +158,8 @@ endif()
set(WINDOWS FALSE)
if (${CMAKE_SYSTEM_NAME} MATCHES Windows)
set(WINDOWS TRUE)
# set(WIN32 TRUE)
if (${CMAKE_GENERATOR} MATCHES "Unix Makefiles")
set(MINGW TRUE)
endif (${CMAKE_GENERATOR} MATCHES "Unix Makefiles")
set(WIN32 TRUE)
set(MINGW TRUE)
endif()

set (ARCH_64bit FALSE)
Expand Down Expand Up @@ -240,6 +244,9 @@ if (${OPTION_TARGET_MOVINGBOUNDARY_SOLVER} OR
add_subdirectory(hdf5-1.8.11)
else()
set(HDF5_USE_STATIC_LIBRARIES ON)
if(WINDOWS OR WIN32 OR WIN64)
set(HDF5_USE_STATIC_LIBRARIES OFF)
endif ()
#CMakeList.txt that comes with hdf5 switches library name if compiled with debug
find_package(HDF5 COMPONENTS HL CXX C)
set(HDF_VERSION ${HDF5_VERSION})
Expand Down
2 changes: 1 addition & 1 deletion ExpressionParser/DivideByZeroException.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DIVIDEBYZEROEXCEPTION_H
#define DIVIDEBYZEROEXCEPTION_CPP
#define DIVIDEBYZEROEXCEPTION_H

#include "ExpressionException.h"

Expand Down
11 changes: 11 additions & 0 deletions FronTierLib/front/fgb3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#include <front/fdecs.h>

#ifdef WIN64
double drand48_windows()
{
const long NUM_RAND = RAND_MAX+1;
const double RAND_TOTAL_MAX = NUM_RAND*NUM_RAND - 1.0;
long r = (NUM_RAND)*rand()+rand();
return r / RAND_TOTAL_MAX;
}
#define drand48 drand48_windows
#endif

LOCAL boolean track_comp_and_repair3d(int*,int*,int*,INTERFACE*,Front*);
LOCAL boolean repair_intfc3d_in_box(INTERFACE*,int*,int*,Front*);
LOCAL boolean set_reconstruction_boxes(int*,int*,int**,int,RECT_BOX**,
Expand Down
2 changes: 2 additions & 0 deletions FronTierLib/front/fprotos.h
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ IMPORT void strip_bdry_curves(INTERFACE*, int);
IMPORT void cut_surface(SURFACE*,boolean (*func)(POINTER,double*),POINTER,boolean);
IMPORT void install_hsbdry_on_surface(SURFACE*,int);
IMPORT boolean surfaces_matched(SURFACE*,SURFACE*);
IMPORT void install_subdomain_bdry_curves(INTERFACE*);

/* fscat3d2.c*/
IMPORT boolean f_intfc_communication3d2(Front*);
Expand Down Expand Up @@ -888,6 +889,7 @@ IMPORT void tangent(POINT*,BOND*,CURVE*,double*,Front*);
IMPORT void user_print_rp_node(RP_NODE*,RPROBLEM*);
IMPORT void user_print_rproblem(RPROBLEM*);
IMPORT void user_free_rp_node(RP_NODE*,RPROBLEM*);
IMPORT void assign_curve_boundary_type(CURVE*,int,int*);

#if defined(USE_OVERTURE)
/* foverture_patch.c */
Expand Down
1 change: 1 addition & 0 deletions FronTierLib/intfc/imksurf.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#include <intfc/int.h>
#include <intfc/iprotos.h>
#include <fprotos.h>

LOCAL void assign_blk_crx(BLK_CRX*,int,int,int,const EG_CRX*,boolean);
LOCAL void assign_two_comp_domain(double (*func)(POINTER,double*),POINTER,
Expand Down
3 changes: 3 additions & 0 deletions FronTierLib/util/simpleio.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <sys/stat.h>
#ifndef WIN32
#include <sys/utsname.h>
#else
#include <process.h>
#define getpid _getpid
#endif
static const char *scan_float_fmt = "%lf";

Expand Down
2 changes: 1 addition & 1 deletion IDAWin/VCellCVodeSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void VCellCVodeSolver::cvodeSolve(bool bPrintProgress, FILE* outputFile, void (*
if (outputCount * (NEQ + 1) * bytesPerSample > MaxFileSizeBytes){
/* if more than one gigabyte, then fail */
char msg[100];
sprintf(msg, "output exceeded maximum %ld bytes", MaxFileSizeBytes);
sprintf(msg, "output exceeded maximum %d bytes", MaxFileSizeBytes);
throw VCell::Exception(msg);
}
writeData(Time, outputFile);
Expand Down
5 changes: 5 additions & 0 deletions MBSolver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ if (SUPPORTS_MATLAB)
option(BUILD_INCLUDE_MATLAB_DIRS "Include matlab integration directory" OFF)
endif (SUPPORTS_MATLAB)

if (MINGW)
add_definitions(-DMINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMINGW")
endif (MINGW)

if(DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
else()
Expand Down
1 change: 1 addition & 0 deletions MBSolver/Solver/include/CoordVect.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _COORDVECT_H_

#include <array>
#include <ostream>
#include <MovingBoundaryTypes.h>
#include <IndexVect.h>
namespace moving_boundary
Expand Down
1 change: 1 addition & 0 deletions MBSolver/Solver/include/Distance.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef Distance_h
#define Distance_h
#include <limits>
#include <cmath>
#include <TPoint.h>
#include <cassert>
Expand Down
4 changes: 3 additions & 1 deletion MBSolver/Solver/include/IndexVect.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#define _INDEXVECT_H_

#include <array>
#include <ostream>
#include <cstddef>
#include <MovingBoundaryTypes.h>

class IndexVect
Expand All @@ -13,7 +15,7 @@ class IndexVect
IndexVect ();
IndexVect (int a, int b);
IndexVect (const IndexVect& rhs);
IndexVect(std::array<size_t, DIM> p);
explicit IndexVect(std::array<std::size_t, DIM> p);

IndexVect& operator= (const IndexVect& rhs);

Expand Down
1 change: 1 addition & 0 deletions MBSolver/Solver/include/MBridge/MBPatch.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef MBPatch_h
#define MBPatch_h
#include <limits>
#include <vector>
#include <iostream>
#include <MBridge/MBMatlabGenerator.h>
Expand Down
1 change: 1 addition & 0 deletions MBSolver/Solver/include/MPoint.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef MPoint_h
#define MPoint_h
#pragma warning ( disable : 4996)
#include <limits>
#include <cassert>
#include <array>
#include <stdexcept>
Expand Down
2 changes: 2 additions & 0 deletions MBSolver/Solver/include/Modulo.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef Modulo_h
#define Modulo_h

#include <limits>

namespace vcell_util {
/**
* modulo integer type
Expand Down
1 change: 1 addition & 0 deletions MBSolver/Solver/include/World.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef World_h
#define World_h
#include <MovingBoundaryTypes.h>
#include <limits>
#include <TPoint.h>
#include <Universe.h>
#include <SVector.h>
Expand Down
17 changes: 0 additions & 17 deletions MBSolver/Solver/include/version.h

This file was deleted.

1 change: 1 addition & 0 deletions MBSolver/Solver/src/CoordVect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <IndexVect.h>
#include <math.h>
#include <istream>
#include <limits>
#include <World.h>
#include <MeshElementNode.h>
#include <MovingBoundaryTypes.h>
Expand Down
2 changes: 1 addition & 1 deletion MBSolver/Solver/src/IndexVect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IndexVect::IndexVect (const IndexVect &iv)
}
}

IndexVect::IndexVect(std::array<size_t, 2> p)
IndexVect::IndexVect(std::array<std::size_t, 2> p)
{
for (int i = 0; i < DIM; ++ i)
{
Expand Down
3 changes: 2 additions & 1 deletion MBSolver/Solver/src/MapTable.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdexcept>
#include <algorithm>
#include <MapTable.h>
#include <MTExpression.h>
Expand All @@ -7,7 +8,7 @@ using VCell::MTExpression;
double MapTable::operator[](std::string name) const {
auto iter = values.find(name);
if (iter == values.end( )) {
throw new std::domain_error("no such name");
throw std::domain_error("no such name");
}
return iter->second;
}
Expand Down
1 change: 1 addition & 0 deletions MBSolver/Solver/src/Mesh.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <cstdint>
#include <stdexcept>
#include <limits>
#pragma warning ( disable: 4018 )
#include <Mesh.h>
#include <VCellException.h>
Expand Down
1 change: 1 addition & 0 deletions MBSolver/Solver/src/MeshElementNode.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <MPoint.h>
#include <sstream>
#include <limits>
#include <cstring>
#include <exception>
#include <algorithm>
Expand Down
3 changes: 2 additions & 1 deletion MBSolver/Solver/src/MovingBoundaryParabolicProblem.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//#pragma warning ( disable: 4996 )
#pragma warning ( disable: 4244 )
#pragma warning ( disable: 4267 )
#include <VCELL/SimulationMessaging.h>
#include <MPoint.h>
#include <boost/logic/tribool.hpp>
#include <World.h>
#include <VoronoiMesh.h>
#include <limits>
#include <cstring>
#include <sstream>
#include <iomanip>
Expand All @@ -28,7 +30,6 @@
#include <IndexVect.h>

#include <ExplicitSolver.h>
#include <VCELL/SimulationMessaging.h>
#include <MBridge/FronTierAdapt.h>
#include <MBridge/Figure.h>
#include <MBridge/MBPatch.h>
Expand Down
4 changes: 3 additions & 1 deletion MBSolver/Solver/src/Polygon.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <limits>
#include <cstdint>
#include <Volume.h>
#include <Edge.h>
Expand All @@ -16,7 +17,8 @@ namespace {
template <typename V>
struct vectorWriter {
std::ostream &os;
vectorWriter(std::ostream &os_)

explicit vectorWriter(std::ostream &os_)
:os(os_) {}
void operator( )(V v) {
vcell_persist::save(os,v);
Expand Down
10 changes: 4 additions & 6 deletions MBSolver/Solver/src/ReportClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <map>
#include <set>
#include <iomanip>
#include <limits>
#include <algo.h>
#include <Mesh.h>
#include <MeshElementNode.h>
Expand All @@ -13,7 +14,6 @@
#include <ReportClient.h>
#include <Universe.h>
#include <TextReportClient.h>
#include <version.h>
#include <flex.h>
#include <vhdf5/dataset.h>
#include <vhdf5/attribute.h>
Expand All @@ -27,6 +27,7 @@
#include <MBridge/Figure.h>
#include <Hdf5OutputWriter.h>
#include <VCELL/SimulationMessaging.h>
#include <VCELL/GitDescribe.h>
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
using moving_boundary::World ;
using moving_boundary::CoordinateType;
Expand Down Expand Up @@ -804,11 +805,8 @@ namespace {
H5::DataSet runTime = vcellH5::primitiveWrite(baseGroup,"runTime",totalTime);
//annotate version info - we place on runTime node to allow easy exclusion when doing
//h5diff (see --exclude-path)
const vcell_util::Version & version = vcell_util::Version::get( );
vcellH5::writeAttribute(runTime,"svnVersion",version.svn);
vcellH5::writeAttribute(runTime,"compileDate",version.compileDate);
vcellH5::writeAttribute(runTime,"compileTime",version.compileTime);

std::string gitVersion(g_GIT_DESCRIBE);
vcellH5::writeAttribute(runTime,"gitVersion", gitVersion);
unsigned int lastTimeIndex = static_cast<unsigned int>(genTimes.size( ));
vcellH5::primitiveWrite(baseGroup,"lastTimeIndex",lastTimeIndex);

Expand Down
1 change: 1 addition & 0 deletions MBSolver/Solver/src/Voronoi32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <vector>
#include <algorithm>
#include <fstream>
#include <limits>
#include "Voronoi.h"
#include "SVector.h"
#include "algo.h"
Expand Down
3 changes: 2 additions & 1 deletion MBSolver/Solver/src/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <Logger.h>
#include <NumericConvert.h>
#include <map>
#include <limits>
#include <list>
#include <iomanip>
#include <boost/math/common_factor.hpp>
Expand Down Expand Up @@ -224,7 +225,7 @@ namespace moving_boundary {
template struct WorldMax<int16_t>;
template struct WorldMax<int32_t>;
template struct WorldMax<long long>;


#ifdef COMPILE_64
template struct World<int64_t,2>;
template struct WorldMax<int64_t>;
Expand Down
Loading

0 comments on commit 8b020bb

Please sign in to comment.