Page 1 of 1

Cannot compile OpenEMM; Spring framework is missing?

Posted: Thu Oct 27, 2011 1:07 pm
by pmw
I would like to run OpenEMM on 64-bit Gentoo. Following the install instructions, I downloaded the source package and tried to compile it. The compilation ran into many errors, starting like this:

Code: Select all

    [mkdir] Created dir: /home/pmw/openemm/build/OpenEMM-2011-bin/webapps/openemm/WEB-INF/classes
    [javac] /home/pmw/openemm/OpenEMM-2011-src/openemm_build.xml:55: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last;
 set to false for repeatable builds   
    [javac] Compiling 575 source files to /home/pmw/openemm/build/OpenEMM-2011-bin/webapps/openemm/WEB-INF/classes
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/ActionOperation.java:26: package org.springframework.context does not
 exist
    [javac] import org.springframework.context.ApplicationContext;
    [javac]                                   ^
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/ActionOperation.java:34: cannot find symbol
    [javac] symbol  : class ApplicationContext
    [javac] location: class org.agnitas.actions.ActionOperation
    [javac]     public abstract boolean executeOperation(ApplicationContext con, int companyID, HashMap params);
    [javac]                                              ^
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/EmmAction.java:29: package org.springframework.context does not exist
    [javac] import org.springframework.context.ApplicationContext;
    [javac]                                   ^
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/EmmAction.java:52: cannot find symbol
    [javac] symbol  : class ApplicationContext
    [javac] location: interface org.agnitas.actions.EmmAction
    [javac]     boolean executeActions(ApplicationContext con, HashMap params);
    [javac]                            ^
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/impl/EmmActionImpl.java:31: package org.springframework.context does not exist
    [javac] import org.springframework.context.ApplicationContext;
    [javac]                                   ^
Please advise.

Re: Cannot compile OpenEMM; Spring framework is missing?

Posted: Sat Oct 29, 2011 4:59 pm
by maschoff
Did you download the JARs tarball of OpenEMM and set the path in oe.home accordingly? (See line 10 of build script)

Re: Cannot compile OpenEMM; Spring framework is missing?

Posted: Sun Oct 30, 2011 2:34 am
by pmw
Thank you, that solved the problem. I was missing the JARs tarball.

Re: Cannot compile OpenEMM; Spring framework is missing?

Posted: Sun Jun 15, 2014 8:58 am
by bhcuong2008
I compile OpenEMM 2013 R2, everything seems to be ok. But it occurs an issue as follow,

===
[exec] gcc -I../lib -I/home/oe/include -pthread -c -o bav.o bav.c
[exec] In file included from bav.h:25:0,
[exec] from bav.c:30:
[exec] ../lib/agn.h:139:2: error: expected identifier before numeric constant
[exec] make: *** [bav.o] Error 1
[exec] Result: 2

BUILD FAILED
/home/oe/src/OpenEMM-2013_R2-src/openemm_build.xml:148: Warning: Could not find resource file "/home/oe/src/OpenEMM-2013_R2-src/src/c/bav/bav" to copy.
===

When opening file agn.h, line 139, I see this. I dont know why. I compile on ubuntu 12.04 64bit.
===
typedef enum { /*{{{*/
false,
true
/*}}}*/
} bool_t;
===

Re: Cannot compile OpenEMM; Spring framework is missing?

Posted: Mon Jun 16, 2014 6:35 am
by ud
Looks like some other include file already defines "false", 'true" or "bool_t". So please try these steps:
- Change to the source directory for bav.c
- Start the command: gcc -E -I../lib -I/home/oe/include -pthread -c -o bav.i bav.c
- Look into the file "bav.i" for the occurrence of bool_t to see where and how it is defined.

-- ud

Re: Cannot compile OpenEMM; Spring framework is missing?

Posted: Mon Jun 16, 2014 9:07 am
by bhcuong2008
Hi ud,

I follow your advice. I see just one occurrence defined in this file. And one definition in agn.h (line 139). What should I do next?

Here is my bav.i file,
https://drive.google.com/file/d/0B59EBc ... sp=sharing

Thank you.

Re: Cannot compile OpenEMM; Spring framework is missing?

Posted: Mon Jun 16, 2014 11:01 am
by ud
If you modify bav.c and insert these two lines just before the inclusion of bav.h:

#undef false
#udnef true

then it should compile.

-- ud

Same as a unified context diff:

--- bav.c.orig 2014-06-16 11:58:04.897116499 +0200
+++ bav.c 2014-06-16 11:58:21.215021164 +0200
@@ -29,6 +29,8 @@
# include <regex.h>
# include <netinet/in.h>
# include "libmilter/mfapi.h"
+# undef false
+# undef true
# include "bav.h"

# define SOCK_PATH "var/run/bav.sock"

Re: Cannot compile OpenEMM; Spring framework is missing?

Posted: Mon Jun 16, 2014 11:32 am
by bhcuong2008
Hi ud,

It's successful :)

Thank you very much.