Open YakovlevMik opened 3 years ago
Hi @YakovlevMik, unfortunately mudpy doesn't yet work on windows machines. Thanks for the output text though, that's useful!
@djasnd: is there something extra needed to compile the mud source on windows machines?
Thank you @dfujim. Would mud-py work on Linux? or is it currently designed for Unix only?
I have it working on Ubuntu 18.04, Ubuntu 20.04, CentOS Tumbleweed, and Scientific Linux; so I would expect it to work on most if not all linux distributions. It should also work on macOS, but I can say which versions.
@djasnd I think I've narrowed down part of the problem, at least.
In mud.h
, I updated the windows OS detection from __MSDOS__
to _WIN32
and the removed the check for __CINT__
. Not sure what __CINT__
is or what the clash would be if it were present (or not?). I'm a little confused about that line. (ef93e68d645faa50477a3a731112c1454d36615e). But with these changes it compiles using the cython extension for mudpy. This uses the Visual Studio compiler, as far as I'm aware.
So the fixes for the cython code were to remove the unused mud_fort.c
and to add the compiler flags -D__CINT__
and -D__MSDOS__
. I think it should compile now, and will push an updated version soon.
Hi DF, I've been looking at it, and sorry for not keeping you abreast. Yes, the problem is not declaring caddr_t. Don't push an update with bogus flags! If you look further down, you'll see the main region of declaration
typedef char* caddr_t;
I would either add "|| defined(_MSC_VER)" or (noticing Borland C and TurboC are other old Windows compilers) replace the two with "|| defined(WIN32)".
CINT is a C++ interpreter. I don't recall why I inserted its treatment separately; I probably had planned to add other conditional statements.
Then there's the quandary. Investigating this, it appears caddr_t has fallen from favor, was not taken into posix, and is deprecated. I'm deciding among options: (1) reverse the sense of tests to check for environments that do declare caddr_t. (2) Change the declared type to be something private. (3) Find something that is indicative of caddr_t being defined, besides the compiler and OS.
It is a struggle to make headway in my new installation of visual studio, but I'll get back to you shortly. I'm also trying to produce a makefile for the whole MUD package.
Regarding fortran, indeed the compilation of fmud_friendly and mud_fort is disabled be default for all platforms these days. Fortran support needs to be explicitly requested when building.
Donald Arseneau TRIUMF CMMS 604-222-1047 x6295
From: Derek Fujimoto @.> Sent: Thursday, August 26, 2021 3:54 PM To: dfujim/mudpy @.> Cc: Donald Arseneau @.>; Mention @.> Subject: Re: [dfujim/mudpy] Windows installation errors (#5)
@djasndhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdjasnd&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687477540%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=p2MfCfLt%2BhC2FSyfjOE%2F2vlhYqyKkAmEct6Ea%2F%2B24WQ%3D&reserved=0 I think I've narrowed down part of the problem, at least.
In mud.h, I updated the windows OS detection from MSDOS to _WIN32 and the removed the check for CINT. Not sure what CINT is or what the clash would be if it were present (or not?). I'm a little confused about that line. (ef93e68https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdfujim%2Fmudpy%2Fcommit%2Fef93e68d645faa50477a3a731112c1454d36615e&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687487533%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=gE%2FnzoBNyF0mLJbH%2FanABp5dYn5UxFIZvZIlv5jFlVQ%3D&reserved=0). But with these changes it compiles using the cython extension for mudpy. This uses the Visual Studio compiler, as far as I'm aware.
So the fixes for the cython code were to remove the unused mud_fort.c and to add the compiler flags -DCINT and -DMSDOS. I think it should compile now, and will push an updated version soon.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdfujim%2Fmudpy%2Fissues%2F5%23issuecomment-906795604&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687487533%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=HyfDHdjru2nQJ4NWu7BUmKbpU95%2Fq0jwmrNInNhhumA%3D&reserved=0, or unsubscribehttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGWGQJSETIESJEJXG6I3NS3T63A2HANCNFSM5CFLJKNA&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687497526%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=vu5apLXvMQB82sTRBsYXgmgowu1UytiV6K7Q3fYicvs%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687497526%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1kOLQFe6wLQXMrWiQuT%2FTiAPJLoxtjmLmF16so4IgtE%3D&reserved=0 or Androidhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687507520%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=tG9QO2ECjbfiv10GRQP9gshQb4%2BuGJoOhureK3DdyAw%3D&reserved=0.
Hi Derek, I made the smallest incremental change using defined( _WIN32) and didn't wade into the quagmire/quandary. I had adventure updating the files because I first pushed them into the parent directory. Please check that it now looks right, and then we can check a new pip-install.
Donald Arseneau TRIUMF CMMS 604-222-1047 x6295
From: Derek Fujimoto @.> Sent: Thursday, August 26, 2021 3:54 PM To: dfujim/mudpy @.> Cc: Donald Arseneau @.>; Mention @.> Subject: Re: [dfujim/mudpy] Windows installation errors (#5)
@djasndhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdjasnd&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687477540%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=p2MfCfLt%2BhC2FSyfjOE%2F2vlhYqyKkAmEct6Ea%2F%2B24WQ%3D&reserved=0 I think I've narrowed down part of the problem, at least.
In mud.h, I updated the windows OS detection from MSDOS to _WIN32 and the removed the check for CINT. Not sure what CINT is or what the clash would be if it were present (or not?). I'm a little confused about that line. (ef93e68https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdfujim%2Fmudpy%2Fcommit%2Fef93e68d645faa50477a3a731112c1454d36615e&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687487533%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=gE%2FnzoBNyF0mLJbH%2FanABp5dYn5UxFIZvZIlv5jFlVQ%3D&reserved=0). But with these changes it compiles using the cython extension for mudpy. This uses the Visual Studio compiler, as far as I'm aware.
So the fixes for the cython code were to remove the unused mud_fort.c and to add the compiler flags -DCINT and -DMSDOS. I think it should compile now, and will push an updated version soon.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdfujim%2Fmudpy%2Fissues%2F5%23issuecomment-906795604&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687487533%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=HyfDHdjru2nQJ4NWu7BUmKbpU95%2Fq0jwmrNInNhhumA%3D&reserved=0, or unsubscribehttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGWGQJSETIESJEJXG6I3NS3T63A2HANCNFSM5CFLJKNA&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687497526%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=vu5apLXvMQB82sTRBsYXgmgowu1UytiV6K7Q3fYicvs%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687497526%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1kOLQFe6wLQXMrWiQuT%2FTiAPJLoxtjmLmF16so4IgtE%3D&reserved=0 or Androidhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Casnd%40triumf.ca%7Cefdc91f18a7748e5e76608d968e4752c%7Cc20535109cb34679a2d38f442e03b587%7C1%7C0%7C637656152687507520%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=tG9QO2ECjbfiv10GRQP9gshQb4%2BuGJoOhureK3DdyAw%3D&reserved=0.
Looks good, except that the python install doesn't work yet. This seems to be related to the checks for __MSDOS__
in mud.h
. This shows as a 'bcopy' undefined
error, which is related to these lines, but the check for __MSDOS__
appears elsewhere as well (such as here and here).
I had originally added the __MSDOS__
flag to setup.py
since that's what the old Makefile.win
script was doing, but it may make more sense to just find/replace __MSDOS__
for _WIN32
. Both solutions allows for the pip installation on my machine.
By the way, you can run the installation from your local files in two ways (both from the directory containing setup.py
):
pip install --user -e .
python setup.py build_ext --inplace
See dc7e1657d6441b9555bb87bbf11c525460ab8ccf
When attempting to install mud-py command prompt returns a mix of syntax (ex. C2143, C2059, C2146) and undeclared identifier (C2065) errors. The errors occur in both
\mud_src\mud.h
and\mud_src\mud.c
. Command Prompt output attached as *.txt filemud-py_install_error.txt
Installation performed via
pip install --user mud-py
, with all prior installations satisfied (machine has installed Visual Studio Build Tools 2019, as well as Visual Studio Community 2019); Python 3.9.6; pip 21.2.3