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

template project code automatically generates output folder if it doesn't exist. #235

Closed
wants to merge 1 commit into from

Conversation

elmbeech
Copy link
Contributor

update to the template project, so that code automatically generates the output folder if it doesn't exist.
this solves issue MathCancer#183.

additionally, i added an std::endl; to the final standard output line that was missing.

@rheiland
Copy link
Collaborator

rheiland commented Jun 2, 2024

On Windows, using MinGW64, I'm seeing:

g++ -march=native  -O3 -fomit-frame-pointer -mfpmath=both -fopenmp -m64 -std=c++11  -o project BioFVM_vector.o BioFVM_mesh.o BioFVM_microenvironment.o BioFVM_solvers.o BioFVM_matlab.o BioFVM_utilities.o BioFVM_basic_agent.o BioFVM_MultiCellDS.o BioFVM_agent_container.o   pugixml.o PhysiCell_phenotype.o PhysiCell_cell_container.o PhysiCell_standard_models.o PhysiCell_cell.o PhysiCell_custom.o PhysiCell_utilities.o PhysiCell_constants.o PhysiCell_basic_signaling.o PhysiCell_signal_behavior.o PhysiCell_rules.o PhysiCell_SVG.o PhysiCell_pathology.o PhysiCell_MultiCellDS.o PhysiCell_various_outputs.o PhysiCell_pugixml.o PhysiCell_settings.o PhysiCell_geometry.o custom.o main.cpp
main.cpp: In function 'int main(int, char**)':
main.cpp:96:22: error: too many arguments to function 'int mkdir(const char*)'
   96 |                 mkdir( PhysiCell_settings.folder.c_str(), 0775 );
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/sys/stat.h:14,
                 from main.cpp:75:
C:/msys64/mingw64/include/io.h:282:15: note: declared here
  282 |   int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |               ^~~~~
main.cpp:102:22: error: too many arguments to function 'int mkdir(const char*)'
  102 |                 mkdir( PhysiCell_settings.folder.c_str(), 0775 );
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/mingw64/include/io.h:282:15: note: declared here
  282 |   int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;

@MathCancer
Copy link
Owner

on hold until it's multi-platform

@elmbeech
Copy link
Contributor Author

elmbeech commented Jun 3, 2024

ok! i understand. still try to fix this, inclusive a unit test for all platforms.

@elmbeech
Copy link
Contributor Author

elmbeech commented Jun 4, 2024

ok, @MathCancer , I merged @drbergman 's Github action to build and run template project on all 3 OS #241 this code and now have a version that seems to compile on all platforms.
I will make a new pull request.

The code as such looks like this:

#if defined(__MINGW32__) || defined(__MINGW64__)
mkdir( PhysiCell_settings.folder.c_str() );
#else
mkdir( PhysiCell_settings.folder.c_str(), 0775 );
#endif

This works because we assume the PhysiCell Windows user to run g++ MINGW.
Frankly, even if this passes the tests, I not completely see through if this is really water tight.

I checked manually on Linux and it does the trick!
@rheiland could you please try the same on Windows and Macos ?

make data-cleanup clean reset
make template
rm -r output
./project 

Thank you, Elmar

@elmbeech
Copy link
Contributor Author

elmbeech commented Jun 4, 2024

this PR was superseeded by PR #243

@elmbeech elmbeech closed this Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants