Comments (4)
Hi @AAlon,
Interesting! It is not like there is absolutely zero documentation (there isn't much, but there is some at least), so who'd imagined I'd forget to add
git clone https://github.com/atolab/zhe ; cd zhe ; mkdir build ; cd build ; cmake .. ; make
to the README 🤔. I imagine it wouldn't have helped, it seems to me you probably did just that and yet ran into problems.
To me the messages you got don't look so much like a c99 versus gnu99 issue, but more like a platform that requires some additional header files (and perhaps macro definitions, like _GNU_SOURCE
, __EXTENSIONS__
, _POSIX_C_SOURCE=199506L
…). Just for good measure, I verified that works fine on macOS and Fedora 29 (and, IIRC, a few variants more).
What is important is that there should be zero issues compiling the files in src
: those were all written with the intent to be strictly conforming C99 code. Now writing "strictly conforming" C is pretty much impossible in practice, but there should certainly not be a problem compiling them. Of course that also means everything that is remotely platform-specific has to be defined elsewhere.
Hence the minimalistic platform abstraction, for which there is some implementation inside the example/platform
directory. The examples themselves also assume some things. That seems to be where your problems lie.
Just adding a #include
or two there will probably solve it, and otherwise some of the stuff can simply be skipped (there is no need to call flockfile
) and one of the calls to random
can be excluded just by changing the definition of SIMUL_PACKET_LOSS
at the top of the file and the other use of it is simply to generate a unique identifier. Indeed, you could even replace random/srandom by rand/srand despite it being a devastingly bad random generator, it is probably still good enough for the purpose here.
If strdup
is not available, it is just a trivial wrapper around strlen
, malloc
and strcpy
, so that should be manageable as well.
Therefore the only really interesting one is struct ip_mreq
. As I don't know what platform you are trying to compile it on, I don't have any suggestion where it is defined ... even if it isn't you can still switch to using TCP instead of UDP and avoid needing it!
from zhe.
Thanks for the thorough response, I think you're right and the suggestions given would get me really close to having a successful build. However at this time I'm preoccupied with other things and cannot spend time on getting it to work.
My platform is nothing special - Ubuntu Bionic on amd64 - and so I had hoped it would work out of the box.
from zhe.
Just an observation - I think @AAlon had been trying to run the makefile in the root of the project rather than using cmake.
from zhe.
Interesting observation. Yes, that makefile in the root of the project is my quick hack for building on any random platform and sometimes sees some modifications.
My platform is nothing special - Ubuntu Bionic on amd64 - and so I had hoped it would work out of the box.
Yes, that's completely standard and it really should work out-of-the-box on it.
I don't have one of those available right now, but if that's the platform I would expect just dropping the "-std=c99" might well do the trick. Curious that they appear to have chosen to let the c99/gnu99 difference have such an effect on what library functions are visible. I'll see if I can get a VM with Ubuntu Bionic up and running tomorrow to sort it out.
from zhe.
Related Issues (4)
- License missing? HOT 1
- No CI for zhe. HOT 2
- What's the plan to release 1.0 version HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zhe.