Topic: Installation on Windows with Cygwin

Hi, I had successfully compiled OOFEM-1.8 on my computer, with WinXP(sp2) and Cygwin and found executable binary program in the "targets/default/bin" directory.

But unfortunately I had some problems when I wanted to builded the utilites in the "tools" directory. I got the messages as following:

g++ -O2 -o systemstudentextractor -DSYSYTEM_STUDENT_EXTRACTOR_MODE checker.C tok
enizer.o seek.o -lm
checker.C: In function `int main(int, char**)':
checker.C:798: error: `basename' undeclared (first use this function)
checker.C:798: error: (Each undeclared identifier is reported only once for each
function it appears in.)
make: *** [systemstudentextractor] Error 1

Of course, I didn't compiler the programs in "tests" directory for testing.

In addition, I wanted to develop new FEM program using Eclipse and Cygwin. But I really don't know how to start.

Could you give me some ideas? Thanks a lot!

2

Re: Installation on Windows with Cygwin

Hi,
to compile checker, follow these steps:
1) open checker.C
2) locate following line

int main(int argc, char *argv[]) {

3) add before this line the following code

char* basename(char* );

4) goto the end of file
5) add following code

char* basename (char* fullPath) {
    char* baseName;
    baseName = strrchr(fullPath,(int)'\\');
    if (baseName++) {
        return baseName;
    } else return fullPath;
}

This works in Visual C++ and I expect that it will work for Cygwin as well.
Please, let me know.

How to start development a new code? Think a lot, study similar projects, and be prepared: it is a run for a long time.

Borek

Re: Installation on Windows with Cygwin

Hi,
bp, thank you for your help!

According to your advices, I had successfully compiled the code in the "tools" directory. But when I tested the oofem package, I found two errors below:

Running tests for module sm
*Error, when checking rule 1
*Error, when checking rule 2
*Error, when checking rule 3
*Error, when checking rule 4
*Error, when checking rule 5
*Error, when checking rule 6
---Checker:      /home/grandpollux/oofem-1.8/tests/sm/crtest10.in    [FAILED]
*Error, when checking rule 1
*Error, when checking rule 3
*Error, when checking rule 4
*Error, when checking rule 5
*Error, when checking rule 6
---Checker:      /home/grandpollux/oofem-1.8/tests/sm/crtest11.in    [FAILED]
...... [OK]
...... [OK]
......
...... [OK]
How to solve these problems?

4

Re: Installation on Windows with Cygwin

Hi,
I have tested it with Visual c++ and it works correctly for both tests (crtest10 and crtest11). Is your problem related to Cygwin or to Visual c++?


Borek

Re: Installation on Windows with Cygwin

I don't know the cause for this problem. Except the test named crtest10 and crtest11, other tests can pass through successfully.