Hi,
Would it be possible to do this check at run time rather than compile time - maybe look for a "WSL_DISTRO_NAME" or "WSLENV" environment variable and set a global flag? A non-WSL compiled EPICS program could be run under WSL, this would not be caught by a compile time check. This problem might be fixed in WSL 2 though, so a WSL version check may be required at some point too.
Regards,
Freddie
-----Original Message-----
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Alfio Rizzo via Tech-talk
Sent: 03 March 2020 09:46
To: tech-talk at aps.anl.gov
Subject: FW: EPICS on windows10 Debian Shell
Hi,
When I compile epics base on a WSL Debian/Ubunt shell So far I manually commented out (when needed) the _WIN32 macro in the blockingUDPTransport.cpp file
But a possible clean solution is to create a macro called WSL , checking the kernel version (my kernel is for instance 4.4.0-17763-Microsoft )
#---------------------------------------------------------------
ifeq ($(findstring Microsoft,$(shell uname -r)),Microsoft)
CPPFLAGS += -D_WSL_
Endif
Those lines can be put in the RULES_BUILD file of EPICS Base for instance,
Then this macro can be used in the blockingUDPTransport.cpp file (see attachment)
It could be possible to apply that in the next EPICS base release patch ?
Thanks
Best
Alfio
-----Original Message-----
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Alfio Rizzo via Tech-talk
Sent: Wednesday, October 2, 2019 6:36 AM
To: Michael Davidsaver <mdavidsaver at gmail.com>
Cc: tech-talk at aps.anl.gov
Subject: RE: EPICS on windows10 Debian Shell
Hi
The macros are defined the same as any GCC Linux/Unix compiler, I have already checked this before.
See file in attachment
Best
Alfio
-----Original Message-----
From: Michael Davidsaver <mdavidsaver at gmail.com>
Sent: Wednesday, October 2, 2019 2:22 AM
To: Alfio Rizzo <Alfio.Rizzo at esss.se>
Cc: tech-talk at aps.anl.gov
Subject: Re: EPICS on windows10 Debian Shell
On 10/1/19 8:55 AM, Alfio Rizzo via Tech-talk wrote:
> As it should be, the OS macro is defined as __linux__ not as _WIN32,
>
> since the compiler is NOT MinGW or CYGWIN, but GNU as I said before.
>
> So, then it comes issue I had was this UDP socket biding issue,
>
> since binding is still handled a la Windows.
>
> So the problem is in the source file blockingUDPTransport.cpp
>
> where the macro _WIN32 is not used consistently in my case.
Can you check what macros this compiler pre-defines?
My usual reference doesn't cover this new variation.
https://sourceforge.net/p/predef/wiki/Home/
> cpp -dM /dev/null > wsl_predefined.h
- References:
- FW: EPICS on windows10 Debian Shell Alfio Rizzo via Tech-talk
- Navigate by Date:
- Prev:
Re: NORD on a char waveform record Mark Rivers via Tech-talk
- Next:
Re: NORD on a char waveform record Mark Rivers via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
<2020>
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
FW: EPICS on windows10 Debian Shell Alfio Rizzo via Tech-talk
- Next:
NORD on a char waveform record Thomas Willemsen - UKRI STFC via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
<2020>
2021
2022
2023
2024
|