Commit d1b0d7999baa371a65643cd7b8b811f8f9d2fe45

Authored by Alain Klotz
1 parent 9a84dd27
Exists in master

Install.sh

install/install.sh
1   -#!/bin/bash
2   -
3   -# pyreverse
4   -echo "===== Requirements for pip"
5   -echo "pip3 install -r requirements.txt"
6   -pip3 install -r requirements.txt
7   -echo "pip3 install -r requirements_dev.txt"
8   -pip3 install -r requirements_dev.txt
9   -
  1 +#!/bin/bash
  2 +
  3 +echo "===== Requirements for pip"
  4 +echo "pip3 install -r requirements.txt"
  5 +pip-compile requirements.in
  6 +pip3 install --user -r requirements.txt
  7 +echo "pip3 install -r requirements_dev.txt"
  8 +pip-compile requirements_dev.in
  9 +pip3 install --user -r requirements_dev.txt
  10 +
  11 +echo "===== Extension"
  12 +cd ../src/libtt
  13 +python3 setup.py build_ext --inplace --user
... ...
src/libtt/wrapper_libtt.cpp
... ... @@ -605,7 +605,6 @@ static PyObject* pimaseries(PyObject* self, PyObject* args) {
605 605 nbkeys = (int)PyObject_Length(py_list_cards);
606 606 printf("nbkeys=%d\n",nbkeys);
607 607  
608   - int v = 0;
609 608 #if defined WITH_LIBTT
610 609 errcode = libtt_main(TT_PTR_ALLOKEYS,6,&nbkeys,&keynames,&values,&comments,&units,&datatypes);
611 610 #endif
... ... @@ -633,9 +632,9 @@ static PyObject* pimaseries(PyObject* self, PyObject* args) {
633 632 kcard++;
634 633 // assign keynames, comments, units
635 634 #if defined WITH_LIBTT
636   - sprintf(keynames[kcard],keyname);
637   - sprintf(comments[kcard],comment);
638   - sprintf(units[kcard],"");
  635 + strcpy(keynames[kcard],keyname);
  636 + strcpy(comments[kcard],comment);
  637 + strcpy(units[kcard],"");
639 638 #endif
640 639 // assign values, datatypes
641 640 if (PyBool_Check(py_val)) {
... ... @@ -651,7 +650,7 @@ static PyObject* pimaseries(PyObject* self, PyObject* args) {
651 650 datatypes[kcard]=TINT;
652 651 #endif
653 652 if (strcmp(keyname, "BITPIX")==0) { bitpix = val_int; }
654   - } else if PyFloat_Check(py_val) {
  653 + } else if (PyFloat_Check(py_val)) {
655 654 #if defined WITH_LIBTT
656 655 sprintf(values[kcard],"%f",(float)PyFloat_AsDouble(py_val));
657 656 datatypes[kcard]=TFLOAT;
... ...
src/libtt/wrapper_libtt.h
... ... @@ -37,7 +37,7 @@ char *char_type_pg(int type);
37 37 void *calloc_pg(size_t nmemb, int type);
38 38 void *copy_p_to_pg(void *p, size_t nelem, int p_type, bool force_pg);
39 39 void *copy_pyarray_to_pg(PyArrayObject *py_array, size_t nelem, bool force_pg);
40   -#define PG_LOOP for (int k = 0 ; k < nelem ; k++)
  40 +#define PG_LOOP for (int k = 0 ; k < (int)nelem ; k++)
41 41 #define PG_MSG_ERR 512
42 42  
43 43 #define MSG 1024
... ...