Skip to content

Commit 6fa158e

Browse files
Fix build of PythonCCS
1 parent 8387fc3 commit 6fa158e

File tree

12 files changed

+25
-20
lines changed

12 files changed

+25
-20
lines changed

doc/converse/manual.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ CCS: Client-Side
21352135
A CCS client connects to a CCS server, asks a server PE to execute a
21362136
pre-registered handler, and receives the response data. The CCS client
21372137
may be written in any language (see CCS network protocol, below), but a
2138-
C interface (files ccs-client.c” and ccs-client.h) and Java interface
2138+
C interface (files "ccs-client.C" and "ccs-client.h") and Java interface
21392139
(file “CcsServer.java”) are available in the charm include directory.
21402140

21412141
The C routines use the skt_abort error-reporting strategy; see

src/ck-core/debug-charm.C

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@
2727
//#include "queueing.h"
2828
#include <unistd.h>
2929

30-
30+
#include "ck.h"
31+
CkpvDeclare(DebugEntryTable, _debugEntryTable);
3132

3233
#if CMK_CHARMDEBUG && CMK_CCS_AVAILABLE && !defined(_WIN32)
3334

34-
#include "ck.h"
35-
3635
CkpvDeclare(int, skipBreakpoint); /* This is a counter of how many breakpoints we should skip */
37-
CkpvDeclare(DebugEntryTable, _debugEntryTable);
3836
CpdPersistentChecker persistentCheckerUselessClass;
3937

4038
void resetAllCRC();

src/conv-ccs/ccs-client.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef __CCS_CLIENT_H_
66
#define __CCS_CLIENT_H_
77

8+
#define CMK_NOT_USE_CONVERSE 1
89
#include "sockRoutines.h"
910
#include "ccs-auth.h"
1011

src/conv-core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
add_library(ccs-client ../conv-ccs/ccs-client.C ../conv-ccs/ccs-client.h)
33
target_include_directories(ccs-client PRIVATE ../util)
4+
configure_file(../conv-ccs/ccs-client.h ${CMAKE_BINARY_DIR}/include/ COPYONLY)
45

56
add_library(memory-default memory.C)
67
target_compile_definitions(memory-default PRIVATE -DCMK_MEMORY_BUILD_DEFAULT)

src/libs/ck-libs/pythonCCS/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CDIR=../../../..
1+
include ../common.mk
22
-include $(CDIR)/include/conv-mach-opt.mak
33
OPTS=-g -Wall
44
CHARMC=$(CDIR)/bin/charmc $(OPTS)
@@ -33,7 +33,7 @@ PythonCCS.o: PythonCCS.C $(HEADDEP)
3333
$(CHARMC) -c $(FLAGS) PythonCCS.C
3434

3535
PythonCCS-client.o: PythonCCS-client.C $(HEADDEP)
36-
$(CHARMC) -c $(FLAGS) PythonCCS-client.C
36+
$(CHARMC) -seq -c $(FLAGS) PythonCCS-client.C
3737

3838
PythonCCS.decl.h PythonCCS.def.h: PythonCCS.ci
3939
$(CHARMXI) PythonCCS.ci

src/libs/ck-libs/pythonCCS/PythonCCS-client.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
PythonIterator needs to be coherent across client and server.
1515
*/
1616

17-
#include "converse.h"
17+
#include <stdint.h>
1818
#include <stdlib.h>
1919
#include <string.h>
2020
#include <stdio.h>
2121
#include <netinet/in.h>
2222

23+
typedef uint32_t CmiUInt4;
24+
2325
/* This class is empty, and should be reimplemented by the user */
2426
class PythonIterator {
2527
/* _It is strongly suggested to avoid pointers_, in which case none of the

src/scripts/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2684,7 +2684,7 @@ fi
26842684
fi
26852685

26862686
#### test if Python headers are installed ####
2687-
PYTHON_VERSION=`python -V 2>&1 | awk {'print $2'} | awk -F. {'print $1"."$2'}`
2687+
PYTHON_VERSION=`python2 -V 2>&1 | awk {'print $2'} | awk -F. {'print $1"."$2'}`
26882688
cat > $t <<EOT
26892689
#include "python${PYTHON_VERSION}/Python.h"
26902690
#include "python${PYTHON_VERSION}/compile.h"

tests/charm++/python/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
-include ../../common.mk
22
CHARMDIR = ../../..
3+
-include $(CHARMDIR)/include/conv-mach-opt.mak
34
CHARMC = $(CHARMDIR)/bin/charmc $(OPTS)
45
INCL = -I/usr/include/python/
5-
LIBS = -lpthread -lutil -ldl -lm -lpython2.5
6+
LIBS = -lpthread -lutil -ldl -lm -lpython$(CMK_BUILD_PYTHON)
67
INCLC = -I$(CHARMDIR)/include/
78
MODULES = -module PythonCCS -module charmdebug_python
89
PYMODULE = $(CHARMDIR)/lib/libmodulePythonCCS.a
@@ -19,7 +20,7 @@ server.decl.h: server.ci $(PYMODULE) $(CHARMDIR)/bin/charmxi
1920
$(CHARMC) $<
2021

2122
client: client.C
22-
g++ $(INCLC) $(OPTS) -o $@ $^ $(PYMODULE)
23+
$(CHARMC) -seq $(INCLC) $(OPTS) -o $@ $^ $(PYMODULE) -lccs-client
2324

2425
clean:
2526
rm -f *.decl.h *.def.h *.o server client charmrun *~

tests/charm++/python/client.C

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <stdlib.h>
22
#include "ccs-client.h"
3-
#include "ccs-client.c"
43
#include "PythonCCS-client.h"
54
#include <string.h>
65
#include <string>
@@ -60,12 +59,15 @@ int main (int argc, char** argv) {
6059

6160
if (useGroups > 0) {
6261
MyIterator *myIter = new MyIterator(htonl(4));
63-
printf("size: %d (%d)\n",myIter->size(),sizeof(*myIter));
64-
wrapper = new PythonExecute((char*)code.c_str(), "metodo", myIter);
65-
pythonString = "CpdPythonGroup";
62+
printf("size: %d (%zu)\n",myIter->size(),sizeof(*myIter));
63+
static char s_metodo[] = "metodo";
64+
wrapper = new PythonExecute(const_cast<char*>(code.c_str()), s_metodo, myIter);
65+
static char s_CpdPythonGroup[] = "CpdPythonGroup";
66+
pythonString = s_CpdPythonGroup;
6667
} else {
67-
wrapper = new PythonExecute((char*)code.c_str());
68-
pythonString = "pyCode";
68+
wrapper = new PythonExecute(const_cast<char*>(code.c_str()));
69+
static char s_pyCode[] = "pyCode";
70+
pythonString = s_pyCode;
6971
}
7072

7173
wrapper->setHighLevel(true);

tests/charm++/python/server.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ MyArray::MyArray () {mynumber = thisIndex+1000;}
7272

7373
MyArray::MyArray (CkMigrateMessage *msg) {}
7474

75-
void MyArray::run(CkCallback &cb) {
75+
void MyArray::run(const CkCallback &cb) {
7676
// CkPrintf("[%d] in run %d\n",thisIndex,mynumber);
7777
double _startTime = CmiWallTimer();
7878

0 commit comments

Comments
 (0)