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

APSIM classic source code compile fail #2225

Open
JoannaYRS opened this issue Jan 28, 2024 · 7 comments · May be fixed by #2228
Open

APSIM classic source code compile fail #2225

JoannaYRS opened this issue Jan 28, 2024 · 7 comments · May be fixed by #2228

Comments

@JoannaYRS
Copy link

Hi,

I'm currently facing some challenges while attempting to compile the entire APSIM model from its source code. Following the steps on the webpage, I encounter [Fail] returns, including '[Fail] Compile General' and '[Fail] Compile ShellExtensions'. I'm using Visual Studio 2017, and I've attached screenshots of the compilation printout for reference.

Additionally, while inspecting the Maize model's code, I noticed incomplete files. For instance, in 'Maize/plant.h', the following lines are present:

#include <ComponentInterface2/ScienceAPI2.h>
#include <ComponentInterface2/DataTypes.h>

However, these two files are missing from the 'ComponentInterface2' directory.

I would appreciate any suggestions or answers. Thank you.

MicrosoftTeams-image
MicrosoftTeams-image (1)
MicrosoftTeams-image (2)
MicrosoftTeams-image (3)

@peter-devoil
Copy link
Collaborator

.. incomplete files.

These files are generated by the build process; and if the build process fails, they won't be there.

I'm guessing that the root issue is that it's not setting up the VS2017 build environment correctly - that's the batch file "VSDevCmd.bat" error. It relies on that to to the autogenerating bit above. Can you investigate if that file is installed, if not - did you install the 32 bit compiler?

@JoannaYRS
Copy link
Author

Thank you very much for your response @peter-devoil . Upon inspecting the BuildAll.bat file, I discovered that the path to VsDevCmd.bat is incorrect for my situation:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"

This is because I originally used Professional 2017. To avoid potential errors, I reinstalled Visual Studio 2017 Community and recompiled APSIM. However, I encountered a new error.
I appreciate any assistance in resolving this issue. Thank you!
image

@peter-devoil
Copy link
Collaborator

You can ignore the cotton error if cotton isn't in your simulations

ShellExtensions are likewise for windows XP - anachronisms.

The missing xml libraries are usually installed alongside the build tree - that's step 2 in https://www.apsim.info/documentation/model-documentation/developer-documentation/building-apsim-from-source/.

I just checked whether that BuildLibraries archive exists - and it appears to have moved. @hol353 - any clues where?

@peter-devoil
Copy link
Collaborator

@JoannaYRS - drop me an email at peter dot devoil at uq.edu.au and I'll send you a download link

@hol353 - perhaps that .7z archive should be in the repo so we dont keep losing it..

@hol353
Copy link
Contributor

hol353 commented Jan 31, 2024

Yes I think the archive should be in the repo somewhere. Does someone want to raise a PR and add it?

peter-devoil added a commit to peter-devoil/APSIMClassic that referenced this issue Feb 5, 2024
@peter-devoil peter-devoil linked a pull request Feb 5, 2024 that will close this issue
@JoannaYRS
Copy link
Author

Thank you very much @peter-devoil and @hol353
Now I have almost all [Pass] except for Cotton, BuildAll, Compile, and Post-Compile. Just wanna make sure, does this mean that I have succeeded in compiling it? (I don't need to simulate cotton, only focusing on maize now)
image

@peter-devoil
Copy link
Collaborator

Yes, the "fail" cascades up the tree of targets - the cotton module is causing the others to fail.

Once upon a time, somebody decided that the IP of the cotton module was valuable and made us put a password on it..

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 a pull request may close this issue.

3 participants